C ++ REST SDK (casablanca): How to get the address of a client connected to http_listener?

I have a small HTTP server written using Casablanca, and I would like to get the IP address of the client who sent the request. I looked at the members of http_request and could not find it.

web::http::experimental::listener::http_listener listener(U("http://*/http_server")); listener.support(web::http::methods::POST, [](web::http::http_request const& request) { std::cout << "client: " << "[ip address]" << " requested " << request << std::endl; }); 
+5
source share

Source: https://habr.com/ru/post/1214985/


All Articles