mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
show UDP tunnels
This commit is contained in:
parent
75065f29f7
commit
325b362727
@ -565,6 +565,32 @@ namespace http {
|
|||||||
s << ":" << it.second->GetLocalPort ();
|
s << ":" << it.second->GetLocalPort ();
|
||||||
s << "</a><br>\r\n"<< std::endl;
|
s << "</a><br>\r\n"<< std::endl;
|
||||||
}
|
}
|
||||||
|
auto& clientForwards = i2p::client::context.GetClientForwards ();
|
||||||
|
if (!clientForwards.empty ())
|
||||||
|
{
|
||||||
|
s << "<br>\r\n<b>Client Forwards:</b><br>\r\n<br>\r\n";
|
||||||
|
for (auto& it: clientForwards)
|
||||||
|
{
|
||||||
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
|
s << "<a href=\"/?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
|
s << it.second->GetName () << "</a> ⇐ ";
|
||||||
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
|
s << "<br>\r\n"<< std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
auto& serverForwards = i2p::client::context.GetServerForwards ();
|
||||||
|
if (!serverForwards.empty ())
|
||||||
|
{
|
||||||
|
s << "<br>\r\n<b>Server Forwards:</b><br>\r\n<br>\r\n";
|
||||||
|
for (auto& it: serverForwards)
|
||||||
|
{
|
||||||
|
auto& ident = it.second->GetLocalDestination ()->GetIdentHash();
|
||||||
|
s << "<a href=\"/?page=" << HTTP_PAGE_LOCAL_DESTINATION << "&b32=" << ident.ToBase32 () << "\">";
|
||||||
|
s << it.second->GetName () << "</a> ⇐ ";
|
||||||
|
s << i2p::client::context.GetAddressBook ().ToAddress(ident);
|
||||||
|
s << "<br>\r\n"<< std::endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPConnection::HTTPConnection (std::shared_ptr<boost::asio::ip::tcp::socket> socket):
|
HTTPConnection::HTTPConnection (std::shared_ptr<boost::asio::ip::tcp::socket> socket):
|
||||||
|
@ -197,9 +197,13 @@ namespace client
|
|||||||
void Start();
|
void Start();
|
||||||
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; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void HandleRecvFromI2P(const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len);
|
void HandleRecvFromI2P(const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len);
|
||||||
UDPSession * ObtainUDPSession(const i2p::data::IdentityEx& from, uint16_t localPort, uint16_t remotePort);
|
UDPSession * ObtainUDPSession(const i2p::data::IdentityEx& from, uint16_t localPort, uint16_t remotePort);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const std::string m_Name;
|
const std::string m_Name;
|
||||||
const uint16_t LocalPort;
|
const uint16_t LocalPort;
|
||||||
@ -220,7 +224,11 @@ namespace client
|
|||||||
void Start();
|
void Start();
|
||||||
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();
|
||||||
|
|
||||||
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(); }
|
||||||
|
|
||||||
|
std::shared_ptr<ClientDestination> GetLocalDestination () const { return m_LocalDest; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void HandleRecvFromI2P(const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len);
|
void HandleRecvFromI2P(const i2p::data::IdentityEx& from, uint16_t fromPort, uint16_t toPort, const uint8_t * buf, size_t len);
|
||||||
void TryResolving();
|
void TryResolving();
|
||||||
|
Loading…
Reference in New Issue
Block a user