What does HackerNews think of Bash-web-server?
A purely bash web server, no socat, netcat, etc...
Language:
Shell
Actually, bash has now a loadable builtin to listen on tcp socket. I wrote a script and the patch. https://github.com/dzove855/Bash-web-server
The patch is now included in bash 5.2
A pure bash web server is indeed possible using a loadable builtin. See: https://github.com/dzove855/Bash-web-server (discussed: https://news.ycombinator.com/item?id=29794979).
Like this you can do it without nc
https://github.com/dzove855/Bash-web-server
This is a wrapper around nc.
Here's a web server in pure bash:
> For example, there is an implementation of an HTTP daemon written purely in bash[2]. Once again-- terrible idea, but great execution.
It's not pure bash, as it relies on netcat or socat plus some other external programs (ls, tree, cat, date).
There does exist a pure bash httpd though. It relies on a loadable builtin (from the bash tree though not built by default).