implemented rpcaddress param

This commit is contained in:
orignal
2026-08-16 21:33:50 -04:00
parent 996a467513
commit c3541c3966
4 changed files with 10 additions and 7 deletions
+5 -3
View File
@@ -1026,7 +1026,8 @@ namespace client
uint16_t port = section.second.get<uint16_t> (TORRENTS_TUNNEL_RPC_PORT, 0);
if (port)
{
auto server = CreateTorrentsRPCServer (port);
auto address = section.second.get<std::string> (TORRENTS_TUNNEL_RPC_ADDRESS, "127.0.0.1");
auto server = CreateTorrentsRPCServer (address, port);
if (server)
{
auto path = section.second.get<std::string> (TORRENTS_TUNNEL_RPC_PATH, "");
@@ -1234,12 +1235,13 @@ namespace client
}
}
std::shared_ptr<i2p::torrents::TorrentsRPCServer> ClientContext::CreateTorrentsRPCServer (uint16_t port)
std::shared_ptr<i2p::torrents::TorrentsRPCServer> ClientContext::CreateTorrentsRPCServer (
std::string_view address, uint16_t port)
{
std::shared_ptr<i2p::torrents::TorrentsRPCServer> server;
try
{
server = std::make_shared<i2p::torrents::TorrentsRPCServer>(port);
server = std::make_shared<i2p::torrents::TorrentsRPCServer>(address, port);
}
catch(std::exception& ex)
{