[kwlug-disc] Can You Write A Web Server in PURE BASH?! (no socat, no netcat, no external tools)
Ronald Barnes
ron at ronaldbarnes.ca
Sat Jul 26 14:39:01 EDT 2025
I figure some folks on this list would enjoy Dave's bash videos. He's
got a real expert level of knowledge and make it fun to learn obscure
bash tricks.
Here, he builds a web server... in pure bash:
> https://www.youtube.com/watch?v=L967hYylZuc
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.
Final product: 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.
More information about the kwlug-disc
mailing list