Browse Source

ntcp2.addressv6 parameter

pull/1347/head
orignal 6 years ago
parent
commit
4c4e856a1a
  1. 7
      daemon/Daemon.cpp
  2. 1
      libi2pd/Config.cpp

7
daemon/Daemon.cpp

@ -165,6 +165,13 @@ namespace i2p @@ -165,6 +165,13 @@ namespace i2p
uint16_t ntcp2port; i2p::config::GetOption("ntcp2.port", ntcp2port);
if (!ntcp && !ntcp2port) ntcp2port = port; // use standard port
i2p::context.PublishNTCP2Address (ntcp2port, true); // publish
if (ipv6)
{
std::string ipv6Addr; i2p::config::GetOption("ntcp2.addressv6", ipv6Addr);
auto addr = boost::asio::ip::address_v6::from_string (ipv6Addr);
if (!addr.is_unspecified () && addr != boost::asio::ip::address_v6::any ())
i2p::context.UpdateNTCP2V6Address (addr); // set ipv6 address if configured
}
}
else
i2p::context.PublishNTCP2Address (port, false); // unpublish

1
libi2pd/Config.cpp

@ -239,6 +239,7 @@ namespace config { @@ -239,6 +239,7 @@ namespace config {
("ntcp2.enabled", value<bool>()->default_value(true), "Enable NTCP2 (default: enabled)")
("ntcp2.published", value<bool>()->default_value(false), "Publish NTCP2 (default: disabled)")
("ntcp2.port", value<uint16_t>()->default_value(0), "Port to listen for incoming NTCP2 connections (default: auto)")
("ntcp2.addressv6", value<std::string>()->default_value("::"), "Address to bind NTCP2 on")
;
options_description nettime("Time sync options");

Loading…
Cancel
Save