Can You Write A Web Server in PURE BASH?! (no socat, no netcat, no external tools)

Although the thought of this challenge is mildly nauseous, the video is mesmerizing! He builds a web server in pure bash, just like he promised. Even enhanced it by cloning and modifying the accept builtin to support keep-alive. https://github.com/bahamas10/bash-web-server *This guy would make The Best presenter at a LUG, hint hint.* Here's his bash web server in action - amazing output: curl ysap.sh It's also amazing in a web browser with JS. I made something similar years ago (a terminal in JS) but not as nicely as https://ysap.sh Also, he highly recommends "pure bash bible": https://github.com/dylanaraps/pure-bash-bible
The goal of this book is to document commonly-known and lesser-known methods of doing various tasks using only built-in bash features. Using the snippets from this bible can help remove unneeded dependencies from scripts and in most cases make them faster. I came across these tips and discovered a few while developing neofetch, pxltrm and other smaller projects.

You need recent Bash for that. :-) Long ago, I wrote "web server" in shell to be used with 'inetd', because I just needed something on the other end that I can easily control for testing. Nowadays, I bring up Apache and call CGI shell script, which is almost the same in terms of control. After use, throw them away, except for the basic "template". On 2025-07-25 05:22, Ron via Talk wrote:
Although the thought of this challenge is mildly nauseous, the video is mesmerizing!
He builds a web server in pure bash, just like he promised. Even enhanced it by cloning and modifying the accept builtin to support keep- alive.
https://github.com/bahamas10/bash-web-server
*This guy would make The Best presenter at a LUG, hint hint.*
Here's his bash web server in action - amazing output:
curl ysap.sh
It's also amazing in a web browser with JS. I made something similar years ago (a terminal in JS) but not as nicely as https://ysap.sh
Also, he highly recommends "pure bash bible":
https://github.com/dylanaraps/pure-bash-bible
The goal of this book is to document commonly-known and lesser-known methods of doing various tasks using only built-in bash features. Using the snippets from this bible can help remove unneeded dependencies from scripts and in most cases make them faster. I came across these tips and discovered a few while developing neofetch, pxltrm and other smaller projects.
------------------------------------ Description: GTALUG Talk Unsubscribe via Talk-unsubscribe@lists.gtalug.org Start a new thread: talk@lists.gtalug.org This message archived at https://lists.gtalug.org/archives/list/ talk@lists.gtalug.org/message/4KQDLEDQPTKCFCC2ZKFWH37KVPKYTMBO/
participants (2)
-
Ron
-
William Park