1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-22 04:04:16 +00:00

don't publish NTCP2 address connected through proxy

This commit is contained in:
orignal 2021-03-06 18:43:50 -05:00
parent ad22247c9e
commit 2d59c968ca
2 changed files with 12 additions and 0 deletions

View File

@ -186,6 +186,11 @@ namespace util
{ {
bool published; i2p::config::GetOption("ntcp2.published", published); bool published; i2p::config::GetOption("ntcp2.published", published);
if (published) if (published)
{
std::string ntcp2proxy; i2p::config::GetOption("ntcp2.proxy", ntcp2proxy);
if (!ntcp2proxy.empty ()) published = false;
}
if (published)
{ {
uint16_t ntcp2port; i2p::config::GetOption("ntcp2.port", ntcp2port); uint16_t ntcp2port; i2p::config::GetOption("ntcp2.port", ntcp2port);
if (!ntcp2port) ntcp2port = port; // use standard port if (!ntcp2port) ntcp2port = port; // use standard port

View File

@ -84,7 +84,14 @@ namespace i2p
NewNTCP2Keys (); NewNTCP2Keys ();
bool ntcp2Published = false; bool ntcp2Published = false;
if (ntcp2) if (ntcp2)
{
i2p::config::GetOption("ntcp2.published", ntcp2Published); i2p::config::GetOption("ntcp2.published", ntcp2Published);
if (ntcp2Published)
{
std::string ntcp2proxy; i2p::config::GetOption("ntcp2.proxy", ntcp2proxy);
if (!ntcp2proxy.empty ()) ntcp2Published = false;
}
}
uint8_t caps = 0; uint8_t caps = 0;
if (ipv4) if (ipv4)
{ {