Skip to main content

Telegram

b4 carries Telegram traffic in three ways. They are independent and can run at the same time.

  • MTProto proxy: a proxy server on b4 that Telegram connects to with a secret. Every Telegram client supports it, from anywhere its port is reachable, such as a phone on mobile data.
  • Telegram over WebSocket: one switch that relays Telegram from every device behind b4 and from the router, with nothing to set up on the devices.
  • Telegram Desktop WEB proxy: the MTProto proxy served as an ordinary HTTPS site, for Telegram Desktop 7.1.1 and later.

Choosing a way​

MTProto proxyTelegram over WebSocketWEB proxy
Set up in Settings > TelegramMTProto Proxy cardTelegram over WebSocket card, or a set's routing modeTelegram Desktop WEB proxy card
On the deviceA proxy entry with a secretNothingA proxy entry from a link
Devices coveredAny Telegram client, inside the network or outside itEvery device behind b4, and the router itselfTelegram Desktop 7.1.1 and later
Needs the MTProto proxy onYesNoYes
Needs a public hostnameOnly for devices outside the local networkNoYes, with a publicly trusted certificate
Needs TPROXY in the kernelNoYesNo

On the home network, Telegram over WebSocket needs nothing on the devices. A phone away from home needs the MTProto proxy. The WEB proxy suits b4 on a VPS with a hostname and a certificate of its own.

Shared settings​

All three reach Telegram through the shared Telegram upstream settings. A Cloudflare Worker is the route to add when media does not load, and a DC Relay helps where the WebSocket routes are blocked as well.

Telegram problems lists symptoms and their fixes, and Settings > Telegram describes every field.