3 ms·
But, bash can't do listen sockets. "loadable accept builtin" Ahh. Gawk can be a web server also, typically just "as-shipped", without any new extensions. Doe
by tyingq 5y ago
But, bash can't do listen sockets.
"loadable accept builtin"
Ahh.
Gawk can be a web server also, typically just "as-shipped", without any new extensions. Doesn't scale well though :)
https://news.ycombinator.com/item?id=22085459 https://news.ycombinator.com/item?id=22085459
- drvdevd 5y agoThis was very interesting to me - I was expecting using linux socket virtual FS paths to create the socket.
- tyingq 5y agoPretty printed: https://gist.github.com/tyingq/4e568425e2e68e6390f3105e588787c6 https://gist.github.com/tyingq/4e568425e2e68e6390f3105e58878... The /inet/tcp/8080/0/0 is a gawk-ism, versus a Linux thing: https://www.gnu.org/software/gawk/manual/html_node/TCP_002fIP-Networking.html https://www.gnu.org/software/gawk/manual/html_node/TCP_002fI... Unfortunately, gawk doesn't let you control the listen/accept part of it, so it doesn't scale well. Not sure why they did it that way. A separate accept() call would have made it actually usable in a non-toy way.
- genewitch 5y agoProbably designed that way on purpose (or at least post hoc) so that a company wouldn't hit a wall with 10,000 users on the gawkttpd. This is how you get stuff like hiPHoP.