mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-21 23:54:14 +00:00
enable SSU
This commit is contained in:
parent
b9031c331d
commit
adb6f284e8
@ -35,7 +35,7 @@ namespace i2p
|
||||
|
||||
i2p::data::RouterInfo routerInfo;
|
||||
routerInfo.SetRouterIdentity (ident);
|
||||
//routerInfo.AddSSUAddress ("127.0.0.1", 17007, routerInfo.GetIdentHash ());
|
||||
routerInfo.AddSSUAddress ("127.0.0.1", 17007, routerInfo.GetIdentHash ());
|
||||
routerInfo.AddNTCPAddress ("127.0.0.1", 17007); // TODO:
|
||||
routerInfo.SetProperty ("caps", "LR");
|
||||
routerInfo.SetProperty ("coreVersion", "0.9.8.1");
|
||||
|
@ -303,6 +303,7 @@ namespace data
|
||||
addr.cost = 2;
|
||||
addr.date = 0;
|
||||
m_Addresses.push_back(addr);
|
||||
m_SupportedTransports |= eNTCPV4;
|
||||
}
|
||||
|
||||
void RouterInfo::AddSSUAddress (const char * host, int port, const uint8_t * key)
|
||||
@ -315,6 +316,7 @@ namespace data
|
||||
addr.date = 0;
|
||||
memcpy (addr.key, key, 32);
|
||||
m_Addresses.push_back(addr);
|
||||
m_SupportedTransports |= eSSUV4;
|
||||
}
|
||||
|
||||
void RouterInfo::SetProperty (const char * key, const char * value)
|
||||
|
@ -39,23 +39,20 @@ namespace i2p
|
||||
auto conn = new i2p::ntcp::NTCPServerConnection (m_Service);
|
||||
m_NTCPAcceptor->async_accept(conn->GetSocket (), boost::bind (&Transports::HandleAccept, this,
|
||||
conn, boost::asio::placeholders::error));
|
||||
// temporary always run SSU server
|
||||
// TODO: uncomment following lines later
|
||||
/*}
|
||||
}
|
||||
else if (address.transportStyle == RouterInfo::eTransportSSU)
|
||||
{*/
|
||||
{
|
||||
if (!m_SSUServer)
|
||||
{
|
||||
m_SSUServer = new i2p::ssu::SSUServer (m_Service, address.port);
|
||||
LogPrint ("Start listening UDP port ", address.port);
|
||||
m_SSUServer->Start ();
|
||||
DetectExternalIP ();
|
||||
}
|
||||
else
|
||||
LogPrint ("SSU server already exists");
|
||||
}
|
||||
}
|
||||
|
||||
//DetectExternalIP ();
|
||||
}
|
||||
|
||||
void Transports::Stop ()
|
||||
|
Loading…
x
Reference in New Issue
Block a user