Telethon: Http proxy with credentials?

Created on 13 Nov 2017  路  3Comments  路  Source: LonamiWebs/Telethon

Is it possible to use http proxy with credentials? As we use pysocks it doesn't have ability to use credentials with http/https proxy, only with socks.

client = TelegramClient('19852561722', api_id, api_hash, proxy=(socks.HTTP, 'zproxy.luminati.io', 22225, 'lum-customer-zone-us_zone', 'jgnm7p3ngww1'))
client.connect()

Raises error socks.GeneralProxyError: Socket error: 407: Proxy Authentication Required

Most helpful comment

I use this to work with proxies

clientP = TelegramClient(phone_number, api_id, api_hash,
                                 proxy=(socks.HTTP, '15.151.70.83', 8000, True, 'log', 'pass'),
                                 timeout=timedelta(seconds=15))

All 3 comments

I don't know very well how proxies work. All I know is the library can't connect to Telegram's servers by using their HTTP mode yet. It's probably possible to use an HTTP proxy to wrap an arbitrary TCP connection. This seems more like a question you should post to https://github.com/Anorov/PySocks.

I use this to work with proxies

clientP = TelegramClient(phone_number, api_id, api_hash,
                                 proxy=(socks.HTTP, '15.151.70.83', 8000, True, 'log', 'pass'),
                                 timeout=timedelta(seconds=15))

@adv-zl seems like you're missing that True between the port and the login. Thanks @Lerbytech!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

saharokk picture saharokk  路  3Comments

ghost picture ghost  路  4Comments

Jinqad picture Jinqad  路  6Comments

wdsjxh picture wdsjxh  路  3Comments

pazis picture pazis  路  5Comments