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

Notifications You must be signed in to change notification settings

HenryChen-CH/Boost-Web-Server

Repository files navigation

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

About

Easy to use, easy to extend, asynchronous multi-threading web server supporting HTTP1.1 and HTTP compression. It is built with Boost Asio library

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •