pyrogram / pyrogram

Elegant, modern and asynchronous Telegram MTProto API framework in Python for users and bots
https://pyrogram.org
GNU Lesser General Public License v3.0
4.33k stars 1.39k forks source link

Does pyrogram work with an http proxy? #388

Closed timoilya closed 4 years ago

timoilya commented 4 years ago

Does pyrogram work with an http proxy? Are you planning to add it?

ColinShark commented 4 years ago

No, Pyrogram does not support HTTP Proxies.

If you have, you can use a Socks5 Proxy.

timoilya commented 4 years ago

@ColinTheShark why is this not supported? any technical nuances?

ColinShark commented 4 years ago

Pyrogram simply does no utilize any HTTP. It relies on encrypted traffic through Telegrams own MTProto Protocol.

timoilya commented 4 years ago

@ColinTheShark but Telethon works with http-proxy

delivrance commented 4 years ago

@timoilya HTTP proxies don't work because adding support for them requires adding support for the whole HTTP transport protocol first, to be used instead of the TCP counterpart, and that is technically very different.

Implementing the HTTP protocol would give people access to HTTP proxies, yes, but that would also give access to a much less reliable protocol, with a higher overhead due to both packet size and the use of long polling techniques instead of server's pushes.

A lot of thought have been put into making the TCP-based protocol stack and the whole library reliable enough to enable bots with half a million monthly active users work flawlessly, just to name an example. Doing the same for HTTP means I need to dedicate time to keep up with the quality, but currently this is a low priority feature.

rnyPlanet commented 3 years ago

@ColinTheShark but Telethon works with http-proxy

do your proxies work on telethon?

timoilya commented 3 years ago

@ColinTheShark but Telethon works with http-proxy

do your proxies work on telethon?

Yes, but it has nothing to do with pyrogram

rnyPlanet commented 3 years ago

Yes, but it has nothing to do with pyrogram

can you show an example of telethon code? I have a problem that he does not want through a proxy

timoilya commented 3 years ago

Yes, but it has nothing to do with pyrogram

can you show an example of telethon code? I have a problem that he does not want through a proxy

yes. you may write to tlgm by my github-username