torrents rpc authorization

This commit is contained in:
orignal
2026-10-14 11:55:08 -04:00
parent 4cd981f88e
commit 2058b43f5d
4 changed files with 56 additions and 4 deletions
+8 -1
View File
@@ -1094,7 +1094,14 @@ namespace client
if (server)
{
auto path = section.second.get<std::string> (TORRENTS_TUNNEL_RPC_PATH, "");
server->AddTunnel (path, torrentsTunnel);
auto auth = section.second.get<bool> (TORRENTS_TUNNEL_RPC_AUTH, false);
std::string user, pass;
if (auth)
{
user = section.second.get<std::string> (TORRENTS_TUNNEL_RPC_USER, "");
pass = section.second.get<std::string> (TORRENTS_TUNNEL_RPC_PASS, "");
}
server->AddTunnel (path, torrentsTunnel, auth, user, pass);
}
}
}