简易 http server

admin 2020-07-13 AM 806℃ 0条

http server

https://github.com/thecoshman/http

https://github.com/svenstaro/miniserve

libevhtp

zimg 使用的http组件,测压优于nginx

http://zimg.buaa.us/documents/Architecture_Design_of_Image_Server/

https://github.com/ellzey/libevhtp

thttpd 编译

https://acme.com/software/thttpd/

centos7

wget https://acme.com/software/thttpd/thttpd-2.27.tar.gz
tar zxvf thttpd-2.27.tar.gz && cd thttpd-2.27
./configure && make

不到一分钟即可编译好. strip 后86KB (非静态编译) , thttpd 内存占用较小,rss显示1.5MB

busybox httpd 占用内存只有几十KB,简单的golang http sever内存占用在2MB左右

darkhttpd

另一个十分小巧的http server

https://unix4lyfe.org/darkhttpd/

curl -L unix4lyfe.org/gitweb/darkhttpd/blob_plain/HEAD:/darkhttpd.c | cc -O2 -o darkhttpd -xc -
darkhttpd . --port 8000

mini_httpd

http://acme.com/software/mini_httpd/

http://linux.bytesex.org/misc/webfs.html

http://proxydb.net/

一个端口转发

https://unix4lyfe.org/portfwd/

其他c语言的简易 http server

https://github.com/ankushagarwal/nweb 采用fork形式处理并发

curl -L raw.githubusercontent.com/ankushagarwal/nweb/master/nweb23.c | cc -O2 -o nweb -xc -
nweb 8000 .

https://github.com/shenfeng/tiny-web-server

curl -L raw.githubusercontent.com/shenfeng/tiny-web-server/master/tiny.c | cc -O2 -o tiny -xc -
tiny 8000
标签: none

非特殊说明,本博所有文章均为博主原创。

评论啦~