项目主要采用Libevent对client的请求进行处理、boost记录日志和切分请求头。
- 支持对静态页面和多种格式文件的访问
- 文件浏览器
- 自定义的错误页面
- 支持CGI模式
- 支持以定时器的方式对空置的连接进行回收
mkdir build
cmake ..
make
sudo make install
在安装完成后在properties.json
中修改自己需要的配置
{
"port": 9999,
"index": "hello.html",
"log_path": "/Users/fss/serverlog/",
"alternate_port": 9998,
"static_page": "/www/http/pages/static/",
"work_path": "/Users/fss/CLionProjects/happyHttp"
}
终端使用命令nohup httpServer &
启动服务器
感谢我的好朋友胡昊为这个项目的开发出谋划策,提供各种各样的帮助。