Simple-Web-Server Documentation
repository·master·Indexed 25 days ago
https://github.com/eidheim/simple-web-serverA lightweight, multithreaded C++11 library for building HTTP and HTTPS servers and clients. Designed for exposing RESTful resources from C++ applications with minimal boilerplate, it supports asynchronous request handling, thread pools, HTTP/1.1 persistent connections, and chunked transfer encoding. Requires Asio and OpenSSL for HTTPS support.
What's inside Simple-Web-Server
- Simple-Web-Server is a fast, multithreaded, and platform-independent HTTP and HTTPS server and client library implemented using C++11. It is designed to provide an easy way to expose REST resources from C++ applications. It supports asynchronous request handling, thread pools, HTTP/1.1 persistent connections, and chunked transfer encoding for clients.
Compile and run Simple-Web-Server
masterTo build the project, use a C++11 compliant compiler and CMake. Follow these steps to create a build directory and compile the source:
mkdir build cd build cmake .. make cd ..Run HTTP examples
masterAfter compiling, you can run the HTTP server and client examples using the generated binary. Once running, you can access the server via a browser at
http://localhost:8080/(or the configured port)../build/http_examplesRun HTTPS examples
masterTo run HTTPS examples, you must first provide an RSA private key (
server.key) and an SSL certificate (server.crt). You can use self-signed certificates for testing. Once the certificates are in place, run the HTTPS examples binary and access the server viahttps://localhost:8080/../build/https_examplesConfigure dependencies for Simple-Web-Server
masterSimple-Web-Server requires the following dependencies:
- Asio: Either Boost.Asio or standalone Asio.
- Boost: Required specifically to compile the provided examples.
- OpenSSL: Required for HTTPS support.