No description
Find a file
Ole Christian Eidheim 6b24b97cf2 Update README.md
2014-07-06 11:06:33 +02:00
httpserver.cpp Some updates and improved examples and comments 2014-07-05 17:55:03 +02:00
httpserver.hpp Initial commit 2014-07-05 11:54:53 +02:00
LICENSE Update LICENSE 2014-07-05 20:05:52 +02:00
main.cpp Minor updates 2014-07-05 20:15:31 +02:00
README.md Update README.md 2014-07-06 11:06:33 +02:00

Simple-Web-Server

A very simple, fast, multithreaded and platform independent HTTP server implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.

Features

  • Thread pool
  • Platform independent
  • HTTP persistent connection (for HTTP/1.1)
  • Simple way to add REST resources using regex for path, and anonymous functions

HTTPS is not yet supported, but take a look at http://www.boost.org/doc/libs/1_55_0/doc/html/boost_asio/example/cpp03/ssl/server.cpp. It does not seem that server.hpp and server.cpp require significant modifications to support HTTPS.

###Usage

See main.cpp for example usage.

Dependency

Boost C++ libraries must be installed, go to http://www.boost.org for download and instructions.

Will update to use C++17 networking instead in the future when it is supported by g++.

Compile and run

Compile with a C++11 compiler supporting regex (for instance g++ 4.9):

g++ -O3 -std=c++11 -lboost_system main.cpp httpserver.cpp -o httpserver

Then to run the server: ./httpserver