diff --git a/include/QHttpEngine/qhttpsocket.h b/include/QHttpEngine/qhttpsocket.h index a8d1d0f..50c7a61 100644 --- a/include/QHttpEngine/qhttpsocket.h +++ b/include/QHttpEngine/qhttpsocket.h @@ -23,6 +23,7 @@ #ifndef QHTTPENGINE_QHTTPSOCKET_H #define QHTTPENGINE_QHTTPSOCKET_H +#include #include #include @@ -202,6 +203,11 @@ public: */ virtual void close(); + /** + * @brief Retrive the address of the remote peer + */ + QHostAddress peerAddress() const; + /** * @brief Determine if the request headers have been parsed yet */ diff --git a/src/qhttpsocket.cpp b/src/qhttpsocket.cpp index 19780dd..d14dda0 100644 --- a/src/qhttpsocket.cpp +++ b/src/qhttpsocket.cpp @@ -222,6 +222,11 @@ void QHttpSocket::close() d->socket->close(); } +QHostAddress QHttpSocket::peerAddress() const +{ + return d->socket->peerAddress(); +} + bool QHttpSocket::isHeadersParsed() const { return d->readState > QHttpSocketPrivate::ReadHeaders;