mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-23 13:24:20 +00:00
set and check proxy status for ipv6 if presented
This commit is contained in:
parent
5fb1247b87
commit
3e3f92c616
@ -463,7 +463,7 @@ namespace i2p
|
|||||||
updated = true;
|
updated = true;
|
||||||
}
|
}
|
||||||
if (host.is_v6 () && address->IsV6 () && address->ssu &&
|
if (host.is_v6 () && address->IsV6 () && address->ssu &&
|
||||||
(!address->ssu->mtu || updated))
|
(!address->ssu->mtu || updated) && m_StatusV6 != eRouterStatusProxy)
|
||||||
{
|
{
|
||||||
// update MTU
|
// update MTU
|
||||||
auto mtu = i2p::util::net::GetMTU (host);
|
auto mtu = i2p::util::net::GetMTU (host);
|
||||||
|
@ -167,6 +167,8 @@ namespace transport
|
|||||||
m_PeerTestTimer = new boost::asio::deadline_timer (*m_Service);
|
m_PeerTestTimer = new boost::asio::deadline_timer (*m_Service);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ipv4; i2p::config::GetOption("ipv4", ipv4);
|
||||||
|
bool ipv6; i2p::config::GetOption("ipv6", ipv6);
|
||||||
i2p::config::GetOption("nat", m_IsNAT);
|
i2p::config::GetOption("nat", m_IsNAT);
|
||||||
m_X25519KeysPairSupplier.Start ();
|
m_X25519KeysPairSupplier.Start ();
|
||||||
m_IsRunning = true;
|
m_IsRunning = true;
|
||||||
@ -190,6 +192,8 @@ namespace transport
|
|||||||
|
|
||||||
m_NTCP2Server->UseProxy(proxytype, proxyurl.host, proxyurl.port, proxyurl.user, proxyurl.pass);
|
m_NTCP2Server->UseProxy(proxytype, proxyurl.host, proxyurl.port, proxyurl.user, proxyurl.pass);
|
||||||
i2p::context.SetStatus (eRouterStatusProxy);
|
i2p::context.SetStatus (eRouterStatusProxy);
|
||||||
|
if (ipv6)
|
||||||
|
i2p::context.SetStatusV6 (eRouterStatusProxy);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LogPrint(eLogError, "Transports: Unsupported NTCP2 proxy URL ", ntcp2proxy);
|
LogPrint(eLogError, "Transports: Unsupported NTCP2 proxy URL ", ntcp2proxy);
|
||||||
@ -227,7 +231,11 @@ namespace transport
|
|||||||
if (proxyurl.parse (ssu2proxy) && proxyurl.schema == "socks")
|
if (proxyurl.parse (ssu2proxy) && proxyurl.schema == "socks")
|
||||||
{
|
{
|
||||||
if (m_SSU2Server->SetProxy (proxyurl.host, proxyurl.port))
|
if (m_SSU2Server->SetProxy (proxyurl.host, proxyurl.port))
|
||||||
|
{
|
||||||
i2p::context.SetStatus (eRouterStatusProxy);
|
i2p::context.SetStatus (eRouterStatusProxy);
|
||||||
|
if (ipv6)
|
||||||
|
i2p::context.SetStatusV6 (eRouterStatusProxy);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
LogPrint(eLogError, "Transports: Can't set SSU2 proxy ", ssu2proxy);
|
LogPrint(eLogError, "Transports: Can't set SSU2 proxy ", ssu2proxy);
|
||||||
}
|
}
|
||||||
@ -237,7 +245,6 @@ namespace transport
|
|||||||
}
|
}
|
||||||
|
|
||||||
// bind to interfaces
|
// bind to interfaces
|
||||||
bool ipv4; i2p::config::GetOption("ipv4", ipv4);
|
|
||||||
if (ipv4)
|
if (ipv4)
|
||||||
{
|
{
|
||||||
std::string address; i2p::config::GetOption("address4", address);
|
std::string address; i2p::config::GetOption("address4", address);
|
||||||
@ -254,7 +261,6 @@ namespace transport
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ipv6; i2p::config::GetOption("ipv6", ipv6);
|
|
||||||
if (ipv6)
|
if (ipv6)
|
||||||
{
|
{
|
||||||
std::string address; i2p::config::GetOption("address6", address);
|
std::string address; i2p::config::GetOption("address6", address);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user