Added Request::remote_endpoint_address and Request::remote_endpoint_port that are read when Request is created.
This commit is contained in:
parent
247639b1e0
commit
5f34b5db5e
3 changed files with 17 additions and 2 deletions
|
|
@ -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>";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue