https://github.com/zjhellofss/happyhttp
一个基于libevent,处理静态页面的httpserver的实现,支持对静态页面和多种格式文件的访问,文件浏览器,自定义的错误页面,支持CGI模式,支持以定时器的方式对空置的连接进行回收
https://github.com/zjhellofss/happyhttp
cpp11 httpserver libevent
Last synced: 3 months ago
JSON representation
一个基于libevent,处理静态页面的httpserver的实现,支持对静态页面和多种格式文件的访问,文件浏览器,自定义的错误页面,支持CGI模式,支持以定时器的方式对空置的连接进行回收
- Host: GitHub
- URL: https://github.com/zjhellofss/happyhttp
- Owner: zjhellofss
- Created: 2020-01-11T07:27:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-26T05:59:14.000Z (over 5 years ago)
- Last Synced: 2024-12-31T20:43:01.911Z (5 months ago)
- Topics: cpp11, httpserver, libevent
- Language: C++
- Homepage:
- Size: 255 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 基于libevent的HttpServer
## 简介
项目主要采用Libevent对client的请求进行处理、boost记录日志和切分请求头。
## 功能1. 支持对静态页面和多种格式文件的访问
2. 文件浏览器
3. 自定义的错误页面
4. 支持CGI模式
5. 支持以定时器的方式对空置的连接进行回收## 编译以及使用
## 编译流程
```shell
mkdir build
cmake ..
make
sudo make install
```## 样例配置文件
在安装完成后在`properties.json`中修改自己需要的配置
```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 &`启动服务器## 致谢
感谢我的好朋友[胡昊](https://github.com/1120023921)为这个项目的开发出谋划策,提供各种各样的帮助。