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 proxy | WebSocket bridge | WEB proxy | |
|---|---|---|---|
| Configured in | Settings, Telegram, MTProto Proxy | Settings, Telegram, Telegram over WebSocket, or a set's routing mode | Settings, Telegram, Telegram Desktop WEB proxy |
| On the client | A proxy entry with a secret | Nothing | A proxy entry from a link |
| Clients covered | Any Telegram client | Every device behind b4, and the router itself | Telegram Desktop 7.1.1 and later |
| Needs the proxy server enabled | Yes | No | Yes |
| Needs a public hostname | Only for clients outside the LAN | No | Yes, with a publicly trusted certificate |
| Needs TPROXY in the kernel | No | Yes | No |
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.