|
|
|
@ -259,6 +259,12 @@ namespace http {
@@ -259,6 +259,12 @@ namespace http {
|
|
|
|
|
s << "<b>Our external address:</b>" << "<br>\r\n" ; |
|
|
|
|
for (const auto& address : i2p::context.GetRouterInfo().GetAddresses()) |
|
|
|
|
{ |
|
|
|
|
if (address->IsNTCP2 ()) |
|
|
|
|
{ |
|
|
|
|
// TODO: show actual address
|
|
|
|
|
s << "NTCP2 supported <br>\r\n"; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
switch (address->transportStyle) |
|
|
|
|
{ |
|
|
|
|
case i2p::data::RouterInfo::eTransportNTCP: |
|
|
|
@ -540,14 +546,8 @@ namespace http {
@@ -540,14 +546,8 @@ namespace http {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ShowTransports (std::stringstream& s) |
|
|
|
|
{ |
|
|
|
|
s << "<b>Transports:</b><br>\r\n<br>\r\n"; |
|
|
|
|
auto ntcpServer = i2p::transport::transports.GetNTCPServer (); |
|
|
|
|
if (ntcpServer) |
|
|
|
|
{ |
|
|
|
|
auto sessions = ntcpServer->GetNTCPSessions (); |
|
|
|
|
if (!sessions.empty ()) |
|
|
|
|
template<typename Sessions> |
|
|
|
|
static void ShowNTCPTransports (std::stringstream& s, const Sessions& sessions, const std::string name) |
|
|
|
|
{ |
|
|
|
|
std::stringstream tmp_s, tmp_s6; uint16_t cnt = 0, cnt6 = 0; |
|
|
|
|
for (const auto& it: sessions ) |
|
|
|
@ -576,15 +576,32 @@ namespace http {
@@ -576,15 +576,32 @@ namespace http {
|
|
|
|
|
} |
|
|
|
|
if (!tmp_s.str ().empty ()) |
|
|
|
|
{ |
|
|
|
|
s << "<div class='slide'><label for='slide_ntcp'><b>NTCP</b> ( " << cnt << " )</label>\r\n<input type='checkbox' id='slide_ntcp'/>\r\n<p class='content'>"; |
|
|
|
|
s << "<div class='slide'><label for='slide_ntcp'><b>" << name << "</b> ( " << cnt << " )</label>\r\n<input type='checkbox' id='slide_ntcp'/>\r\n<p class='content'>"; |
|
|
|
|
s << tmp_s.str () << "</p>\r\n</div>\r\n"; |
|
|
|
|
} |
|
|
|
|
if (!tmp_s6.str ().empty ()) |
|
|
|
|
{ |
|
|
|
|
s << "<div class='slide'><label for='slide_ntcp6'><b>NTCP6</b> ( " << cnt6 << " )</label>\r\n<input type='checkbox' id='slide_ntcp6'/>\r\n<p class='content'>"; |
|
|
|
|
s << "<div class='slide'><label for='slide_ntcp6'><b>" << name << "6</b> ( " << cnt6 << " )</label>\r\n<input type='checkbox' id='slide_ntcp6'/>\r\n<p class='content'>"; |
|
|
|
|
s << tmp_s6.str () << "</p>\r\n</div>\r\n"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void ShowTransports (std::stringstream& s) |
|
|
|
|
{ |
|
|
|
|
s << "<b>Transports:</b><br>\r\n<br>\r\n"; |
|
|
|
|
auto ntcpServer = i2p::transport::transports.GetNTCPServer (); |
|
|
|
|
if (ntcpServer) |
|
|
|
|
{ |
|
|
|
|
auto sessions = ntcpServer->GetNTCPSessions (); |
|
|
|
|
if (!sessions.empty ()) |
|
|
|
|
ShowNTCPTransports (s, sessions, "NTCP"); |
|
|
|
|
} |
|
|
|
|
auto ntcp2Server = i2p::transport::transports.GetNTCP2Server (); |
|
|
|
|
if (ntcp2Server) |
|
|
|
|
{ |
|
|
|
|
auto sessions = ntcp2Server->GetNTCP2Sessions (); |
|
|
|
|
if (!sessions.empty ()) |
|
|
|
|
ShowNTCPTransports (s, sessions, "NTCP2"); |
|
|
|
|
} |
|
|
|
|
auto ssuServer = i2p::transport::transports.GetSSUServer (); |
|
|
|
|
if (ssuServer) |
|
|
|
|