6

I have a small HTTP server written with Casablanca and I would like to get the IP address of the client that 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;
});

0 Answers0