4 ms·
(Shamelessly plugging my own project) It's sort of amazing how little userspace code a crude webserver using Linux syscalls can be: https://github.com/jcalvino
by jcalvinowens 4y ago
(Shamelessly plugging my own project)
It's sort of amazing how little userspace code a crude webserver using Linux syscalls can be: https://github.com/jcalvinowens/asmhttpd https://github.com/jcalvinowens/asmhttpd
One 4K page of code! No stack!
- stefanos82 4y agoAmazing job mate! +1 How much traffic can it handle, have you benchmark it?
- agumonkey 4y agohighly readable, kudos
- jmholla 4y agoThat's real neat. I was messing around with it an threw together this Dockerfile for a tiny server container. Just mount the desired folder to `/http`: FROM alpine as build RUN apk add --no-cache build-base gcompat nasm RUN mkdir /src COPY \* /src RUN cd /src \ && make FROM scratch COPY --from=build /src/asmhttpd /asmhttpd CMD ["/asmhttpd", "/http"] (Run: `podman build -t $IMAGE .; podman run -p 8080:80 -v $PATH:/http -d $IMAGE`)
- matheusmoreira 4y agoThat's awesome.