Skip to main content

Telegram

b4 carries Telegram traffic three ways. They are independent, they can run at the same time, and the one that fits depends on what can be changed on the client.

  • MTProto proxy - a proxy server clients connect to with a secret entered in Telegram's own proxy settings. Every Telegram client supports it, and it reaches b4 from anywhere its port is open, which is what makes it the option for a phone on a cellular network.
  • Telegram over WebSocket - a switch on Settings, Telegram. b4 diverts Telegram's TCP connections from every device behind it, and from the router itself, into a bridge that relays them, so nothing is configured on the device. A per-set routing mode feeds the same bridge for chosen devices or interfaces only.
  • Telegram Desktop WEB proxy - the same stream served over ordinary HTTPS on a hostname of its own. Telegram Desktop 7.1.1 and later loads that hostname in a hidden WebView, so the client opens no MTProto socket at all.
MTProto proxyWebSocket bridgeWEB proxy
Configured inSettings, Telegram, MTProto ProxySettings, Telegram, Telegram over WebSocket, or a set's routing modeSettings, Telegram, Telegram Desktop WEB proxy
On the clientA proxy entry with a secretNothingA proxy entry from a link
Clients coveredAny Telegram clientEvery device behind b4, and the router itselfTelegram Desktop 7.1.1 and later
Needs the proxy server enabledYesNoYes
Needs a public hostnameOnly for clients outside the LANNoYes, with a publicly trusted certificate
Needs TPROXY in the kernelNoYesNo

All three reach Telegram's data centres through the same Telegram upstream settings, which apply even when the proxy server itself is off. Two upstream routes have enough setup of their own to sit on separate pages: the Cloudflare Worker relay, and the DC Relay for a network where the WebSocket transport is blocked as well.

Symptoms and the log lines that identify them are collected in Troubleshooting.

info

The per-setting reference for the Telegram tab, including the fields none of these pages walk through, is Settings, Telegram.