一个绝对简单的Web服务器:tsws
jopen
9年前
TSWS, 一个绝对简单的Web服务器。采用Bash和Netcat实现。
Getting Started
git clone https://github.com/dfletcher/tsws.git cd tsws ./tsws 127.0.0.1 8080 & chromium http://127.0.0.1:8080
You can use TSWS as a library:
TSWS_LIBRARY=1 . tsws declare www_index_Content_Type="text/html; charset=utf-8" function www_index { echo "<html><body>My index is better than the default.</body></html>" } tsws 127.0.0.1 8080
Have a look at the source code for many more details and discussion, including theory of opreation and creating dynamic content.