Proxy Settings

Hydrogram supports proxies with and without authentication. This feature allows Hydrogram to exchange data with Telegram through an intermediate SOCKS 4/5 or HTTP (CONNECT) proxy server.


To use Hydrogram with a proxy, use the proxy parameter in the Client class. If your proxy doesn’t require authorization you can omit username and password.

 from hydrogram import Client

 proxy = {
     "scheme": "socks5",  # "socks4", "socks5" and "http" are supported
     "hostname": "",
     "port": 1234,
     "username": "username",
     "password": "password"

app = Client("my_account", proxy=proxy)