Skip to content

Commit

Permalink
Updated the simple example
Browse files Browse the repository at this point in the history
  • Loading branch information
yhirose committed Jan 8, 2021
1 parent e42a358 commit 85b4abb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ Simple examples
#### Server

```c++
#define CPPHTTPLIB_OPENSSL_SUPPORT
#include "path/to/httplib.h"

// HTTP
httplib::Server svr;

// HTTPS
#define CPPHTTPLIB_OPENSSL_SUPPORT
httplib::SSLServer svr;

svr.Get("/hi", [](const httplib::Request &, httplib::Response &res) {
Expand All @@ -32,11 +34,13 @@ svr.listen("0.0.0.0", 8080);
#### Client

```c++
#define CPPHTTPLIB_OPENSSL_SUPPORT
#include "path/to/httplib.h"

// HTTP
httplib::Client cli("http://cpp-httplib-server.yhirose.repl.co");

// HTTPS
#define CPPHTTPLIB_OPENSSL_SUPPORT
httplib::Client cli("https://cpp-httplib-server.yhirose.repl.co");

auto res = cli.Get("/hi");
Expand Down Expand Up @@ -711,6 +715,7 @@ NOTE: cpp-httplib currently supports only version 1.1.1.
```c++
#define CPPHTTPLIB_OPENSSL_SUPPORT
#include "path/to/httplib.h"
// Server
httplib::SSLServer svr("./cert.pem", "./key.pem");
Expand Down

0 comments on commit 85b4abb

Please sign in to comment.