• Home
Name Date Size #Lines LOC

..--

tests/03-May-2024-322250

web/03-May-2024-1816

CMakeLists.txtD03-May-20241.8 KiB5341

LICENSED03-May-20241.1 KiB2217

README.mdD03-May-20241.9 KiB5535

client_http.hppD03-May-202418.9 KiB441381

client_https.hppD03-May-20246.8 KiB141127

crypto.hppD03-May-20248.7 KiB221165

http_examples.cppD03-May-20249.7 KiB221122

https_examples.cppD03-May-20249 KiB207118

server_http.hppD03-May-202419.3 KiB466364

server_https.hppD03-May-20244 KiB9170

README.md

1Simple-Web-Server [![Build Status](https://travis-ci.org/eidheim/Simple-Web-Server.svg?branch=master)](https://travis-ci.org/eidheim/Simple-Web-Server)
2=================
3
4A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
5
6See https://github.com/eidheim/Simple-WebSocket-Server for an easy way to make WebSocket/WebSocket Secure endpoints in C++. Also, feel free to check out the new C++ IDE supporting C++11/14/17: https://github.com/cppit/jucipp.
7
8### Features
9
10* Asynchronous request handling
11* Thread pool if needed
12* Platform independent
13* HTTPS support
14* HTTP persistent connection (for HTTP/1.1)
15* Client supports chunked transfer encoding
16* Timeouts, if any of Server::timeout_request and Server::timeout_content are >0 (default: Server::timeout_request=5 seconds, and Server::timeout_content=300 seconds)
17* Simple way to add REST resources using regex for path, and anonymous functions
18
19### Usage
20
21See http_examples.cpp or https_examples.cpp for example usage.
22
23See particularly the JSON-POST (using Boost.PropertyTree) and the GET /match/[number] examples, which are most relevant.
24
25### Dependencies
26
27* Boost C++ libraries
28* For HTTPS: OpenSSL libraries
29
30### Compile and run
31
32Compile with a C++11 compliant compiler:
33```sh
34mkdir build
35cd build
36cmake ..
37make
38cd ..
39```
40
41#### HTTP
42
43Run the server and client examples: `./build/http_examples`
44
45Direct your favorite browser to for instance http://localhost:8080/
46
47#### HTTPS
48
49Before running the server, an RSA private key (server.key) and an SSL certificate (server.crt) must be created. Follow, for instance, the instructions given here (for a self-signed certificate): http://www.akadia.com/services/ssh_test_certificate.html
50
51Run the server and client examples: `./build/https_examples`
52
53Direct your favorite browser to for instance https://localhost:8080/
54
55