From aa21fdb36dd9f82149922820589b220b92cde8ba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:35:28 +0000 Subject: [PATCH 1/2] Initial plan From df68bea69018007ee11d76d01fc6433942ea89ab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:41:29 +0000 Subject: [PATCH 2/2] Enable uvloop with SOCKS5 for improved performance Co-authored-by: xrh0905 <29017419+xrh0905@users.noreply.github.com> --- README.md | 3 +-- mtprotoproxy.py | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e9fe1e2..f4560ea 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ The proxy can be launched: You can configure the MTProto proxy to use a SOCKS5 proxy for outgoing connections to Telegram servers. This is useful when your server cannot directly connect to Telegram or you want to route traffic through another proxy. -**Note:** SOCKS5 mode is incompatible with middle proxy advertising and uvloop. +**Note:** SOCKS5 mode is incompatible with middle proxy advertising. #### Configuration in config.py #### @@ -133,5 +133,4 @@ services: **Important:** When SOCKS5 is enabled: - The middle proxy feature is automatically disabled -- uvloop acceleration is not available - Channel advertising may not work diff --git a/mtprotoproxy.py b/mtprotoproxy.py index 57fe0f0..e64b189 100755 --- a/mtprotoproxy.py +++ b/mtprotoproxy.py @@ -326,7 +326,7 @@ def apply_upstream_proxy_settings(): import socks print_err( - "Socket-proxy mode activated, it is incompatible with advertising and uvloop" + "Socket-proxy mode activated, it is incompatible with advertising" ) socks.set_default_proxy( socks.PROXY_TYPE_SOCKS5, @@ -2472,9 +2472,6 @@ def reload_signal(signum, frame): def try_setup_uvloop(): - if config.SOCKS5_HOST and config.SOCKS5_PORT: - # socks mode is not compatible with uvloop - return try: import uvloop