Added Request::remote_endpoint_address and Request::remote_endpoint_port that are read when Request is created.

This commit is contained in:
eidheim 2015-06-27 10:43:17 +02:00
commit 5f34b5db5e
3 changed files with 17 additions and 2 deletions

View file

@ -57,7 +57,7 @@ int main() {
//Responds with request-information
server.resource["^/info$"]["GET"]=[](HttpsServer::Response& response, shared_ptr<HttpsServer::Request> request) {
stringstream content_stream;
content_stream << "<h1>Request from " << request->endpoint.address().to_string() << " (" << request->endpoint.port() << ")</h1>";
content_stream << "<h1>Request from " << request->remote_endpoint_address.to_string() << " (" << request->remote_endpoint_port << ")</h1>";
content_stream << request->method << " " << request->path << " HTTP/" << request->http_version << "<br>";
for(auto& header: request->header) {
content_stream << header.first << ": " << header.second << "<br>";