我有一个用 Casablanca 编写的小型 HTTP 服务器,我想获取发送请求的客户端的 IP 地址。我查看了http_request的成员,没有找到。
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;
});