https://github.com/dzove855/Bash-web-server Skip to content Sign up * Why GitHub? + Features + Mobile + Actions + Codespaces + Packages + Security + Code review + Issues + Integrations + GitHub Sponsors + Customer stories * Team * Enterprise * Explore + Explore GitHub + Learn and contribute + Topics + Collections + Trending + Learning Lab + Open source guides + Connect with others + The ReadME Project + Events + Community forum + GitHub Education + GitHub Stars program * Marketplace * Pricing + Plans + Compare plans + Contact Sales + Education [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} dzove855 / Bash-web-server Public * Notifications * Fork 2 * Star 132 * A purely bash web server, no socat, netcat, etc... MIT License 132 stars 2 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Latest commit @dzove855 dzove855 Merge pull request #1 from cheese1/main ... 4633a8f Jan 4, 2022 Merge pull request #1 from cheese1/main typo 4633a8f Git stats * 6 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time LICENSE Initial commit Jan 4, 2022 README.md typo Jan 4, 2022 bash-server.sh Create bash-server.sh Jan 4, 2022 View code Bash-web-server Requirement How to Problems... README.md Bash-web-server A purely bash web server, no socat, netcat, etc... Requirement * bash 5.1 * loadable accept builtin (http://git.savannah.gnu.org/cgit/ bash.git/tree/examples/loadables/accept.c) How to The port can be set by the env var: HTTP_PORT The path to accept (Directory) can be set by using: BASH_LOADABLE_PATH The scripts need a file as first argument which will be source. The file will need a function named runner, which will be run on each request Problems... Well there's a little problem... since accept doesn't close the connection (Or i'm doing something wrong), the connection will go into TIME_WAIT. This means that we need to wait the time the connection will be closed, after that we can reopen a connection. I will have a look at the source code and probably provide some options, like a bind-address and a close when the FD is closed. About A purely bash web server, no socat, netcat, etc... Resources Readme License MIT License Stars 132 stars Watchers 3 watching Forks 2 forks Releases No releases published Packages 0 No packages published Contributors 2 * @dzove855 dzove855 * @cheese1 cheese1 Languages * Shell 100.0% * (c) 2022 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.