Route Pyrogram's MTProto connection through the SOCKS5 proxy too
HTTP_PROXY/HTTPS_PROXY only affect HTTP client libraries - Pyrogram talks to Telegram's datacenters over raw MTProto/TCP, which never respected those env vars. On a network that can't reach Telegram directly, every Client() call hung in an infinite "Connection timed out" retry loop - exactly what made Telegram linking "get stuck" on prod. Added a TELEGRAM_PROXY config (opt-in via TELEGRAM_PROXY_HOST, unset by default so dev's direct access needs no change) and passed it into all four pyrogram.Client() construction sites. Co-Authored-By:Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019i3NAUkLkHNbsPg5vKfzF9
Showing
Please
register
or
sign in
to comment