addressAsText, getRemoteProxiedAddress

This commit is contained in:
Alex Hultman
2020-06-06 19:52:28 +02:00
parent 2538cd18e9
commit d5782fdb9c
6 changed files with 46 additions and 15 deletions
+3
View File
@@ -1,4 +1,5 @@
#include "App.h"
#include <iostream>
/* Note that uWS::SSLApp({options}) is the same as uWS::App() when compiled without SSL support */
@@ -9,6 +10,8 @@ int main() {
.cert_file_name = "../misc/cert.pem",
.passphrase = "1234"
}).get("/*", [](auto *res, auto *req) {
std::cout << res->getRemoteAddressAsText() << std::endl;
std::cout << res->getProxiedRemoteAddressAsText() << std::endl;
res->end("Hello world!");
}).listen(3000, [](auto *token) {
if (token) {