@@ -715,6 +715,8 @@ class _http_request final : public http::details::http_msg_base, public std::ena
715715
716716 _ASYNCRTIMP void set_request_uri (const uri&);
717717
718+ const utility::string_t & remote_address () const { return m_remote_address; }
719+
718720 const pplx::cancellation_token &cancellation_token () const { return m_cancellationToken; }
719721
720722 void set_cancellation_token (const pplx::cancellation_token &token)
@@ -755,6 +757,8 @@ class _http_request final : public http::details::http_msg_base, public std::ena
755757
756758 void _set_base_uri (const http::uri &base_uri) { m_base_uri = base_uri; }
757759
760+ void _set_remote_address (const utility::string_t &remote_address) { m_remote_address = remote_address; }
761+
758762private:
759763
760764 // Actual initiates sending the response, without checking if a response has already been sent.
@@ -778,6 +782,8 @@ class _http_request final : public http::details::http_msg_base, public std::ena
778782 std::shared_ptr<progress_handler> m_progress_handler;
779783
780784 pplx::task_completion_event<http_response> m_response;
785+
786+ utility::string_t m_remote_address;
781787};
782788
783789
@@ -869,6 +875,12 @@ class http_request
869875 // / </remarks>
870876 const http_headers &headers () const { return _m_impl->headers (); }
871877
878+ // / <summary>
879+ // / Returns a string representation of the remote IP address.
880+ // / </summary>
881+ // / <returns>The remote IP address.</returns>
882+ const utility::string_t & get_remote_address () const { return _m_impl->remote_address (); }
883+
872884 // / <summary>
873885 // / Extract the body of the request message as a string value, checking that the content type is a MIME text type.
874886 // / A body can only be extracted once because in some cases an optimization is made where the data is 'moved' out.
0 commit comments