mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-29 20:27:49 +02:00
Merge c86a1f63a2
into 09f233dbfb
This commit is contained in:
commit
2ee7074686
6 changed files with 38 additions and 10 deletions
|
@ -977,8 +977,12 @@ namespace http {
|
||||||
{
|
{
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
s << it.second->GetName () << "</a> ⇐ ";
|
s << it.second->GetName () << "</a> ";
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
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 << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
auto httpProxy = i2p::client::context.GetHttpProxy ();
|
auto httpProxy = i2p::client::context.GetHttpProxy ();
|
||||||
|
@ -986,8 +990,10 @@ namespace http {
|
||||||
{
|
{
|
||||||
auto& ident = httpProxy->GetLocalDestination ()->GetIdentHash();
|
auto& ident = httpProxy->GetLocalDestination ()->GetIdentHash();
|
||||||
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
s << "HTTP " << tr("Proxy") << "</a> ⇐ ";
|
s << "HTTP " << tr("Proxy") << "</a> ";
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "; ";
|
||||||
|
s << httpProxy->GetLocalEndpoint().address() << ":" << httpProxy->GetLocalEndpoint().port();
|
||||||
|
s << " ⇒ ";
|
||||||
s << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
auto socksProxy = i2p::client::context.GetSocksProxy ();
|
auto socksProxy = i2p::client::context.GetSocksProxy ();
|
||||||
|
@ -995,8 +1001,10 @@ namespace http {
|
||||||
{
|
{
|
||||||
auto& ident = socksProxy->GetLocalDestination ()->GetIdentHash();
|
auto& ident = socksProxy->GetLocalDestination ()->GetIdentHash();
|
||||||
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
s << "SOCKS " << tr("Proxy") << "</a> ⇐ ";
|
s << "SOCKS " << tr("Proxy") << "</a> ";
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident) << "; ";
|
||||||
|
s << httpProxy->GetLocalEndpoint().address() << ":" << httpProxy->GetLocalEndpoint().port();
|
||||||
|
s << " ⇒ ";
|
||||||
s << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
|
@ -1008,7 +1016,9 @@ namespace http {
|
||||||
{
|
{
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
s << it.second->GetName () << "</a> ⇒ ";
|
s << it.second->GetName () << "</a> ";
|
||||||
|
s << it.second->GetEndpoint().address() << ":" << it.second->GetEndpoint().port();
|
||||||
|
s << " ⇐ ";
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
s << ":" << it.second->GetLocalPort ();
|
s << ":" << it.second->GetLocalPort ();
|
||||||
s << "</a></div>\r\n"<< std::endl;
|
s << "</a></div>\r\n"<< std::endl;
|
||||||
|
@ -1024,8 +1034,12 @@ namespace http {
|
||||||
{
|
{
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
s << it.second->GetName () << "</a> ⇐ ";
|
s << it.second->GetName () << "</a> ";
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
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 << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
s << "</div>\r\n";
|
s << "</div>\r\n";
|
||||||
|
@ -1038,7 +1052,9 @@ namespace http {
|
||||||
{
|
{
|
||||||
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
s << "<div class=\"listitem\"><a href=\"" << webroot << "?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
s << it.second->GetName () << "</a> ⇐ ";
|
s << it.second->GetName () << "</a> ";
|
||||||
|
s << it.second->GetEndpoint().address() << ":" << it.second->GetEndpoint().port();
|
||||||
|
s << " ⇐ ";
|
||||||
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
s << "</div>\r\n"<< std::endl;
|
s << "</div>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@ namespace proxy {
|
||||||
// Implements TCPIPAcceptor
|
// Implements TCPIPAcceptor
|
||||||
std::shared_ptr<i2p::client::I2PServiceHandler> CreateHandler(std::shared_ptr<boost::asio::ip::tcp::socket> socket);
|
std::shared_ptr<i2p::client::I2PServiceHandler> CreateHandler(std::shared_ptr<boost::asio::ip::tcp::socket> socket);
|
||||||
const char* GetName() { return m_Name.c_str (); }
|
const char* GetName() { return m_Name.c_str (); }
|
||||||
|
const std::string GetRemoteDestination() { return ""; }
|
||||||
|
int GetRemoteDestinationPort() { return 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,9 @@ namespace client
|
||||||
virtual void Stop () = 0;
|
virtual void Stop () = 0;
|
||||||
|
|
||||||
virtual const char* GetName() { return "Generic I2P Service"; }
|
virtual const char* GetName() { return "Generic I2P Service"; }
|
||||||
|
virtual const std::string GetRemoteDestination() { return ""; }
|
||||||
|
virtual int GetRemoteDestinationPort() { return -1; }
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -161,6 +161,8 @@ namespace client
|
||||||
void Stop ();
|
void Stop ();
|
||||||
|
|
||||||
const char* GetName() { return m_Name.c_str (); }
|
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);
|
void SetKeepAliveInterval (uint32_t keepAliveInterval);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -34,6 +34,8 @@ namespace proxy
|
||||||
// Implements TCPIPAcceptor
|
// Implements TCPIPAcceptor
|
||||||
std::shared_ptr<i2p::client::I2PServiceHandler> CreateHandler(std::shared_ptr<boost::asio::ip::tcp::socket> socket);
|
std::shared_ptr<i2p::client::I2PServiceHandler> CreateHandler(std::shared_ptr<boost::asio::ip::tcp::socket> socket);
|
||||||
const char* GetName() { return m_Name.c_str (); }
|
const char* GetName() { return m_Name.c_str (); }
|
||||||
|
const std::string GetRemoteDestination() { return ""; }
|
||||||
|
int GetRemoteDestinationPort() { return 0; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
|
@ -96,6 +96,7 @@ namespace client
|
||||||
const char * GetName () const { return m_Name.c_str(); }
|
const char * GetName () const { return m_Name.c_str(); }
|
||||||
std::vector<std::shared_ptr<DatagramSessionInfo> > GetSessions ();
|
std::vector<std::shared_ptr<DatagramSessionInfo> > GetSessions ();
|
||||||
std::shared_ptr<ClientDestination> GetLocalDestination () const { return m_LocalDest; }
|
std::shared_ptr<ClientDestination> GetLocalDestination () const { return m_LocalDest; }
|
||||||
|
const boost::asio::ip::udp::endpoint& GetEndpoint () const { return m_RemoteEndpoint; }
|
||||||
|
|
||||||
void SetUniqueLocal (bool isUniqueLocal = true) { m_IsUniqueLocal = isUniqueLocal; }
|
void SetUniqueLocal (bool isUniqueLocal = true) { m_IsUniqueLocal = isUniqueLocal; }
|
||||||
|
|
||||||
|
@ -134,6 +135,8 @@ namespace client
|
||||||
void Start ();
|
void Start ();
|
||||||
void Stop ();
|
void Stop ();
|
||||||
const char * GetName () const { return m_Name.c_str(); }
|
const char * GetName () const { return m_Name.c_str(); }
|
||||||
|
const std::string GetRemoteDestination() { return m_RemoteDest; }
|
||||||
|
uint16_t GetRemoteDestinationPort() { return RemotePort; }
|
||||||
std::vector<std::shared_ptr<DatagramSessionInfo> > GetSessions ();
|
std::vector<std::shared_ptr<DatagramSessionInfo> > GetSessions ();
|
||||||
|
|
||||||
bool IsLocalDestination (const i2p::data::IdentHash & destination) const { return destination == m_LocalDest->GetIdentHash(); }
|
bool IsLocalDestination (const i2p::data::IdentHash & destination) const { return destination == m_LocalDest->GetIdentHash(); }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue