在linux下基于《Linux高性能服务器编程》和tinyhttpd扩展实现的C++轻量级HttpServer,基于epoll事件驱动I/O,采用高效的Reactor模型+线程池进行客户端连接任务管理,支持高并发的静态与动态http请求。项目有详细中文注释,适合新手入门!
post.html、post.cgi和test.html需要一定的权限才可以执行
- cd httpdocs
- sudo chmod 600 post.html
- sudo chmod 600 test.html
- sudo chmod a+x post.cgi
- git clone https://github.com/guoxuanhan/TinyHttpd.git
- 解压缩 unzip TinyHttpd-master.zip 没有zip工具可以先安装 sudo yum -y install unzip
- cd TinyHttpd-master
- make
- ./myhttp
- 动态请求解析技术CGI
- Reactor模式
- epoll I/O多路复用
- 线程池
- socket网络编程相关知识
- http报文格式
- http请求命令 get/post
- 进程通信(管道pipe)
- 增加命令行解析
- 增加定时器删除不常用连接
- 内存池