Forums

Telegram MTProto whitelist

I tryed to start a simple Pyrogram example but was not working and had issue in connection.

Seems that telegram MTProto is not using dns names due to several reasons: - The system DNS service might be unstable, or even untrustful. - IP addresses and ports need to change frequently to react to network issues. Static IPs could be inaccessible in some regions. Then elastic IPs could be deployed to proxy traffic to data centers. The app should be able to update its endpoint configuration in time. - Solutions like Geo DNS is good for very coarse-grained IP selection. It’s better for the backend to control it directly.

It would be possible to whitelist Telegram IPs instead?

Check out this

The problem might be the proxy. The library I'm using (pyrogram) is not supporting HTTP proxies but SOCKS5 ones, but I didn't see the settings to use for pythonanywhere: are they available? Thank you!

Unfortunately not -- free accounts on PythonAnywhere can only access the external Internet by using an HTTP/HTTPS proxy. Telegram does support that, but it sounds like you'd need to use a different library.