Bash-web-server
2022-1-7 16:59:0 Author: github.com(查看原文) 阅读量:18 收藏

A purely bash web server, no socat, netcat, etc...

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

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.

  • Implement logging and provide a logging format like httpd
  • Implement multi processing (this will be a huge step, but we need to patch accept)
  • Implement urlencode/decode to provide readable get data

文章来源: https://github.com/y35uishere/Bash-web-server
如有侵权请联系:admin#unsafe.sh