Telethon: python 3.8 proxy bug
Hi everyone.
Running python64 3.8 under Windows 10
proxy = (socks.SOCKS5, '1.1.1.1', 1111)
client = TelegramClient(sessions_folder + phone, api_id, api_hash, proxy=proxy)
client.connect()
I am able to connect despite using not valid proxy, hence the proxy is not used. Under python 3.7 i get expected “can’t connect” response.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (12 by maintainers)
Commits related to this issue
- Warn users with ProactorEventLoop about proxy issues (#1337) — committed to LonamiWebs/Telethon by Lonami 5 years ago
- Check for event loop method, not type (#1337) — committed to LonamiWebs/Telethon by Lonami 5 years ago
I did some research. ProactorEventLoop causing the proxy to be ignored. In python 3.8 changelog:
Setting event loop to SelectorEventLoop fixes the issue.
asyncio.set_event_loop(asyncio.SelectorEventLoop())
I’m having similar issue: client ignores proxy settings, it’s trying to connect to servers directly.
3.8 32bit