DEV Community

Humja Jaan
Humja Jaan

Posted on

MTProto Proxies for Telegram: Why They Work Where VPNs Fail — and How to Set The

You open Telegram. Gray cloud. Nothing sends. If you're in Iran, Russia, or China, this isn't a bug—it's censorship. Your government is intercepting traffic to Telegram's servers using Deep Packet Inspection (DPI) to recognize and drop the connection.

People often reach for a VPN first. That works, but VPNs are heavy: they encrypt all your device traffic, drain battery, and often get blocked themselves (especially in China where protocols like OpenVPN and WireGuard are easily fingerprinted). MTProto proxies are lighter, faster, and designed specifically for Telegram. Here's how they work, how to set them up on every platform, and where to find proxies that stay online.


Why Telegram Gets Blocked

  • Iran blocks Telegram because it's been a hub for protest coordination and uncensored news. The government has its own sanctioned messaging apps.
  • Russia tried to block Telegram in 2018 after it refused to hand over encryption keys. The block failed technically, but DPI still catches many connections.
  • China blocks Telegram entirely. The Great Firewall uses DPI and active probing to detect Telegram's protocol fingerprint.

All three countries use the same trick: inspect packet headers and match patterns specific to Telegram's MTProto transport. Once detected, they either reset the TCP connection or drop packets.


What MTProto Actually Is (And Why It's Not a VPN)

MTProto is Telegram's own encrypted transport protocol. An MTProto proxy is a lightweight relay server that sits between your Telegram client and the Telegram servers. The proxy does not decrypt your messages—it only forwards encrypted traffic. But it adds an obfuscation layer: it wraps the MTProto packets in a different protocol.

The common obfuscation modes:

  • Simple (dd): Adds random padding to avoid packet size fingerprints.
  • Obfuscated (ee): Encrypts the first bytes of the connection with a preset key to look like random noise.
  • FakeTLS: Makes the initial handshake look like a TLS 1.2/1.3 request (HTTPS). Very effective against DPI in Russia and China.

The key difference from a VPN: MTProto proxies only handle Telegram traffic. Your other apps and browser stay on your normal internet connection. That means less battery drain, less data overhead, and no need to route Netflix or YouTube through a proxy. For a detailed breakdown of battery and data costs on mobile, check out this comparison guide.


Step-by-Step Setup

All you need is a proxy link in the format:

tg://proxy?server=123.123.123.123&port=443&secret=ee0123456789abcdef...
Enter fullscreen mode Exit fullscreen mode

You paste this into Telegram's built-in proxy settings. No separate app required.

Android

  1. Open Telegram, go to Settings → Data and Storage → Proxy Settings.
  2. Tap Add Proxy, then paste the tg:// link. Telegram will parse and fill the fields automatically.
  3. Tap the proxy to enable it (you'll see a green dot next to the server).

Pro tip: Enable "Use for Calls" if you want voice calls to go through the proxy too. Disable it if you experience audio lag.

iOS

  1. Open Telegram, go to Settings → Data and Storage → Proxy.
  2. Tap Add Proxy, choose MTProto.
  3. Tap the link icon (→) and paste the tg:// URL. The fields will auto-fill.
  4. Tap Save and then slide the switch to enable it.

iOS users often hit a weird issue: the proxy appears enabled but the gray cloud persists. Double-check the Secret field—if it contains characters after the first 64 hex chars, trim them. Further troubleshooting tips for iOS are covered in this detailed proxy setup guide.

Desktop (Telegram Desktop / macOS)

  1. Open Telegram Desktop, click the hamburger menu (☰) → Settings → Advanced → Connection Type.
  2. Select Use custom proxy, choose MTProto.
  3. Fill in the Server, Port, and Secret manually from the tg:// link. (Desktop doesn't support pasting the full tg:// URL—you must copy the components.)
  4. Click Apply and then Save.

On macOS, the same steps apply. The secret field accepts both hex and human-readable forms.


Troubleshooting the Gray Cloud

Proxy is dead

Most free proxies last anywhere from 6 hours to 2 weeks. Test another one immediately. If you add several proxies, Telegram automatically fails over to the next working one (on mobile; Desktop requires manual switching).

Wrong secret type

  • If you're in China or Russia, prefer a FakeTLS secret that starts with 64 or 65 (these are common TLS versions).
  • If you're in Iran, standard obfuscated secrets (ee…) often still work, but FakeTLS is safer.
  • A valid secret is exactly 64 hex characters (for obfuscated) or 66 for FakeTLS (the first two bytes indicate the TLS version).

DPI is blocking your chosen port

Port 443 (HTTPS) is ideal. Some ISPs throttle ports 80 and 443 but allow 8443 or 8080. Try a proxy with a non-standard port.

Full device VPN interference

If you have a VPN running alongside the proxy, they may conflict. Try disabling the VPN and using only the proxy for Telegram. If you must use a VPN, set it to split-tunnel and exclude Telegram from the VPN connection (or route only Telegram through the proxy).

Desktop won't connect

Desktop (especially Linux) sometimes needs libproxy or system proxy settings to be cleared. Ensure you're not double-proxying through a system-level proxy.


Keeping Your Proxies Fresh

Manually collecting proxies from Telegram channels is tedious—most die within hours. A better approach is to use a curated, automatically updated list. The free-mtproto-proxies repository on GitHub scrapes live proxies from multiple sources every few minutes, filters for online status and FakeTLS support, and presents them in a clean HTML listing. You can click any proxy link directly from your browser to add it to Telegram.

The repo also includes a JSON endpoint if you want to build your own testing script. The proxies are pre-checked, so you waste less time on dead endpoints.


One Last Thing

MTProto proxies don't hide your IP from Telegram (the proxy sees your IP, Telegram sees the proxy's IP). For anonymity, you'd need a VPN or Tor. But for just getting Telegram to work under censorship, MTProto proxies are the lightest, most reliable tool. They use about 10-15% less battery than a full VPN and don't slow down your other apps.

Start with the proxy list from the repo, add 3-4 proxies to Telegram at once, and you'll stay connected even when servers go down. The gray cloud doesn't have to be permanent.

Top comments (0)