Re:Show HN: Nano-web, a low latency one binary webserver des...
by qwerty456127 on Monday March 25, 2024 @11:14AM
(#39817343)
Thanks, I'll take a look. I also care about it being reasonably secure so I don't write it myself (I'm far from a pro in avoiding vulnerabilities) and also prefer to decrease the attack surface by giving up all non-essential features.
gzip is unnecessary because 99% of the traffic I would serve is going to be pre-compressed (like zip and jpeg files).
I wrote something similar long ago in < 400 lines of Go (with most of it being templates and mimetype information) that just supports GET, HEAD and gzip, in case you're interested[4].
[1] https://caddyserver.com/docs/quick-starts/static-files
[2] https://www.npmjs.com/package/sirv-cli
[3] https://openwrt.org/docs/guide-user/services/webserver/http....
[4] https://github.com/supriyo-biswas/gohttpd