diff --git a/daemon/HTTPServer.cpp b/daemon/HTTPServer.cpp index f9b034ae..1357111e 100644 --- a/daemon/HTTPServer.cpp +++ b/daemon/HTTPServer.cpp @@ -977,8 +977,12 @@ namespace http { { auto& ident = it.second->GetLocalDestination ()->GetIdentHash(); s << "
"; - s << it.second->GetName () << " ⇐ "; - s << i2p::client::context.GetAddressBook ().ToAddress(ident); + s << it.second->GetName () << " "; + s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "; "; + s << it.first.address() << ":" << it.first.port(); + s << " ⇒ "; + if (it.second->GetRemoteDestination() != "") // no remote destination for proxy + s << it.second->GetRemoteDestination() << ":" << it.second->GetRemoteDestinationPort(); s << "
\r\n"<< std::endl; } auto httpProxy = i2p::client::context.GetHttpProxy (); @@ -986,8 +990,10 @@ namespace http { { auto& ident = httpProxy->GetLocalDestination ()->GetIdentHash(); s << "
"; - s << "HTTP " << tr("Proxy") << " ⇐ "; - s << i2p::client::context.GetAddressBook ().ToAddress(ident); + s << "HTTP " << tr("Proxy") << " "; + s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "; "; + s << httpProxy->GetLocalEndpoint().address() << ":" << httpProxy->GetLocalEndpoint().port(); + s << " ⇒ "; s << "
\r\n"<< std::endl; } auto socksProxy = i2p::client::context.GetSocksProxy (); @@ -995,8 +1001,10 @@ namespace http { { auto& ident = socksProxy->GetLocalDestination ()->GetIdentHash(); s << "
"; - s << "SOCKS " << tr("Proxy") << " ⇐ "; - s << i2p::client::context.GetAddressBook ().ToAddress(ident); + s << "SOCKS " << tr("Proxy") << " "; + s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "; "; + s << httpProxy->GetLocalEndpoint().address() << ":" << httpProxy->GetLocalEndpoint().port(); + s << " ⇒ "; s << "
\r\n"<< std::endl; } s << "\r\n"; @@ -1008,7 +1016,9 @@ namespace http { { auto& ident = it.second->GetLocalDestination ()->GetIdentHash(); s << "
"; - s << it.second->GetName () << " ⇒ "; + s << it.second->GetName () << " "; + s << it.second->GetEndpoint().address() << ":" << it.second->GetEndpoint().port(); + s << " ⇐ "; s << i2p::client::context.GetAddressBook ().ToAddress(ident); s << ":" << it.second->GetLocalPort (); s << "
\r\n"<< std::endl; @@ -1024,8 +1034,12 @@ namespace http { { auto& ident = it.second->GetLocalDestination ()->GetIdentHash(); s << "
"; - s << it.second->GetName () << " ⇐ "; - s << i2p::client::context.GetAddressBook ().ToAddress(ident); + s << it.second->GetName () << " "; + s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "; "; + s << it.first.address() << ":" << it.first.port(); + s << " ⇒ "; + if (it.second->GetRemoteDestination() != "") // no remote destination for proxy + s << it.second->GetRemoteDestination() << ":" << it.second->GetRemoteDestinationPort(); s << "
\r\n"<< std::endl; } s << "\r\n"; @@ -1038,7 +1052,9 @@ namespace http { { auto& ident = it.second->GetLocalDestination ()->GetIdentHash(); s << "
"; - s << it.second->GetName () << " ⇐ "; + s << it.second->GetName () << " "; + s << it.second->GetEndpoint().address() << ":" << it.second->GetEndpoint().port(); + s << " ⇐ "; s << i2p::client::context.GetAddressBook ().ToAddress(ident); s << "
\r\n"<< std::endl; } diff --git a/libi2pd_client/HTTPProxy.h b/libi2pd_client/HTTPProxy.h index 69ed4cef..def99609 100644 --- a/libi2pd_client/HTTPProxy.h +++ b/libi2pd_client/HTTPProxy.h @@ -28,6 +28,8 @@ namespace proxy { // Implements TCPIPAcceptor std::shared_ptr CreateHandler(std::shared_ptr socket); const char* GetName() { return m_Name.c_str (); } + const std::string GetRemoteDestination() { return ""; } + int GetRemoteDestinationPort() { return 0; } private: diff --git a/libi2pd_client/I2PService.h b/libi2pd_client/I2PService.h index e14f85c1..9a750ba3 100644 --- a/libi2pd_client/I2PService.h +++ b/libi2pd_client/I2PService.h @@ -67,6 +67,9 @@ namespace client virtual void Stop () = 0; virtual const char* GetName() { return "Generic I2P Service"; } + virtual const std::string GetRemoteDestination() { return ""; } + virtual int GetRemoteDestinationPort() { return -1; } + private: diff --git a/libi2pd_client/I2PTunnel.h b/libi2pd_client/I2PTunnel.h index 4c7b2002..e8f52dcb 100644 --- a/libi2pd_client/I2PTunnel.h +++ b/libi2pd_client/I2PTunnel.h @@ -161,6 +161,8 @@ namespace client void Stop (); const char* GetName() { return m_Name.c_str (); } + const std::string GetRemoteDestination() { return m_Destination; } + int GetRemoteDestinationPort() { return m_DestinationPort; } void SetKeepAliveInterval (uint32_t keepAliveInterval); private: diff --git a/libi2pd_client/SOCKS.h b/libi2pd_client/SOCKS.h index f41cfd72..c855229e 100644 --- a/libi2pd_client/SOCKS.h +++ b/libi2pd_client/SOCKS.h @@ -34,6 +34,8 @@ namespace proxy // Implements TCPIPAcceptor std::shared_ptr CreateHandler(std::shared_ptr socket); const char* GetName() { return m_Name.c_str (); } + const std::string GetRemoteDestination() { return ""; } + int GetRemoteDestinationPort() { return 0; } private: diff --git a/libi2pd_client/UDPTunnel.h b/libi2pd_client/UDPTunnel.h index 862ce216..d5c04936 100644 --- a/libi2pd_client/UDPTunnel.h +++ b/libi2pd_client/UDPTunnel.h @@ -96,6 +96,7 @@ namespace client const char * GetName () const { return m_Name.c_str(); } std::vector > GetSessions (); std::shared_ptr GetLocalDestination () const { return m_LocalDest; } + const boost::asio::ip::udp::endpoint& GetEndpoint () const { return m_RemoteEndpoint; } void SetUniqueLocal (bool isUniqueLocal = true) { m_IsUniqueLocal = isUniqueLocal; } @@ -134,6 +135,8 @@ namespace client void Start (); void Stop (); const char * GetName () const { return m_Name.c_str(); } + const std::string GetRemoteDestination() { return m_RemoteDest; } + uint16_t GetRemoteDestinationPort() { return RemotePort; } std::vector > GetSessions (); bool IsLocalDestination (const i2p::data::IdentHash & destination) const { return destination == m_LocalDest->GetIdentHash(); }