diff --git a/include/fc/network/http/connection.hpp b/include/fc/network/http/connection.hpp index 3c8de77..786f24d 100644 --- a/include/fc/network/http/connection.hpp +++ b/include/fc/network/http/connection.hpp @@ -40,11 +40,12 @@ namespace fc { struct request { fc::string get_header( const fc::string& key )const; + fc::string remote_endpoint; fc::string method; fc::string domain; fc::string path; - std::vector
headers; - std::vector body; + std::vector
headers; + std::vector body; }; std::vector
parse_urlencoded_params( const fc::string& f ); diff --git a/src/network/http/http_connection.cpp b/src/network/http/http_connection.cpp index 309866d..59fb39b 100644 --- a/src/network/http/http_connection.cpp +++ b/src/network/http/http_connection.cpp @@ -134,6 +134,7 @@ fc::tcp_socket& connection::get_socket()const { http::request connection::read_request()const { http::request req; + req.remote_endpoint = fc::variant(get_socket().remote_endpoint()).as_string(); std::vector line(1024*8); int s = my->read_until( line.data(), line.data()+line.size(), ' ' ); // METHOD req.method = line.data();