From 024d449e34def0c3178969b209fefb45bae67bc7 Mon Sep 17 00:00:00 2001 From: Ole Christian Eidheim Date: Sat, 12 Jul 2014 21:29:11 +0200 Subject: [PATCH] Update README.md --- README.md | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2d3d4c0..9c308f5 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,19 @@ 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. +A very simple, fast, multithreaded and platform independent HTTP and HTTPS 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 +* HTTPS support * 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 require significant modifications to support HTTPS. - ###Usage -See main.cpp for example usage. +See main_http.cpp or main_https.cpp for example usage. See particularly the JSON-POST (using Boost.PropertyTree) and the GET /match/[number] examples, which are most relevant. @@ -22,14 +21,27 @@ See particularly the JSON-POST (using Boost.PropertyTree) and the GET /match/[nu Boost C++ libraries must be installed, go to http://www.boost.org for download and instructions. +For HTTPS: OpenSSL libraries from https://www.openssl.org are required. + 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 -o httpserver +## HTTP -Then to run the server: ./httpserver +g++ -O3 -std=c++11 -lboost_system main_http.cpp -o http_server + +Then to run the server: ./http_server Finally, direct your favorite browser to for instance http://localhost:8080/ + +## HTTPS + +g++ -O3 -std=c++11 -lboost_system -lssl -lcrypto main_https.cpp -o https_server + +Then to run the server: ./https_server + +Finally, direct your favorite browser to for instance https://localhost:8080/ +