From 84172d47a40c3ed1c846e075706910118c03cc7c Mon Sep 17 00:00:00 2001 From: SysAdmin Date: Fri, 3 Oct 2025 12:45:46 +0100 Subject: [PATCH] Feature: Add TorSocksHost configuration support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allows TOR proxy host to be configured via Privacy:TorSocksHost setting. Defaults to 127.0.0.1 if not specified for backward compatibility. This enables using external TOR gateways in Docker/container environments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- TeleBot/TeleBot/Http/Socks5HttpHandler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TeleBot/TeleBot/Http/Socks5HttpHandler.cs b/TeleBot/TeleBot/Http/Socks5HttpHandler.cs index 23619a3..65d90f7 100644 --- a/TeleBot/TeleBot/Http/Socks5HttpHandler.cs +++ b/TeleBot/TeleBot/Http/Socks5HttpHandler.cs @@ -21,8 +21,9 @@ namespace TeleBot.Http if (torEnabled) { + var torSocksHost = configuration.GetValue("Privacy:TorSocksHost") ?? "127.0.0.1"; var torSocksPort = configuration.GetValue("Privacy:TorSocksPort", 9050); - var proxyUri = $"socks5://127.0.0.1:{torSocksPort}"; + var proxyUri = $"socks5://{torSocksHost}:{torSocksPort}"; logger?.LogInformation("SOCKS5 proxy configured: {ProxyUri} (TOR enabled)", proxyUri);