Skip to content
Easy to use, easy to extend, asynchronous multi-threading web server supporting HTTP1.1 and HTTP compression. It is built with Boost Asio library
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cpp-markdown @ ff99845
deploy
foo/bar
googletest @ d62d6c6
nginx-configparser @ bd6edc6
src
test
.gitignore
.gitmodules
.travis.yml
Dockerfile
Makefile
README.md
_config.yml
config
integration-test.py
multi-thread-integration-test.py
proxy-integration-test.sh
proxy-test.sh

README.md

Asynchronous Wed Server

Build Status

This is an Extensible Web Server Using Boost Asio Library, supporting HTTP1.1, HTTP Compression and Multi-Threading.


Usage:

Get the source code:

git clone --recursive https://github.com/HenryChen-CH/Boost-Web-Server.git

Change into the directory:

cd ./Boost-Web-Server

Compile:

make

Tips: When you just change one source file or very few files, you just need to remove the corresponding .o file, and compile again, it will greatly speed up compiling process.
Run:

./webserver <config>   

Run tests:

make test

Docker

How To Add Handler

You can conveniently add Handler extending function of the server.

  • Create your own class. Be sure using .cc .h as file extension
  • Your Handler class should inherit RequestHandler class
  • Implement all virtual functions of RequestHandler class
  • call REGISTER_REQUEST_HANDLER(YourClassName) in header file
  • Configure your handler in config file
  • All Done, you can compile and run now

Config File Format

listen <port number>;   
path /path HandlerName {   
  HandlerOptions;   
}

Dependency

sudo apt-get install libboost-all-dev
sudo apt-get install zlib1g-dev

Based On:

Boost HTTP Server Example

You can’t perform that action at this time.