When a direct WebSocket connection to a Telegram data-center is unavailable — for example, because the DC IP is blocked by your ISP or by a national firewall — TG WS Proxy automatically falls back to routing traffic through Cloudflare. This works by connecting to subdomains of a Cloudflare-proxied domain whose DNS A-records point to the Telegram DC IPs; Cloudflare then proxies the WebSocket traffic on to the destination. No dedicated server is required — only a domain. TG WS Proxy ships with a built-in pool of default CF proxy domains, but you are strongly encouraged to set up your own.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Flowseal/tg-ws-proxy/llms.txt
Use this file to discover all available pages before exploring further.
Cloudflare enforces per-domain limits on concurrent WebSocket connections. The default built-in domains are shared across all TG WS Proxy users, so they can hit those limits and stop working at any time. Using your own domain gives you a dedicated quota and full control.
How CF proxy works
The proxy constructs WebSocket URLs using the following subdomain pattern against your domain:| Subdomain | Telegram DC IP |
|---|---|
kws1.<yourdomain> | 149.154.175.50 (DC 1) |
kws2.<yourdomain> | 149.154.167.51 (DC 2) |
kws3.<yourdomain> | 149.154.175.100 (DC 3) |
kws4.<yourdomain> | 149.154.167.91 (DC 4) |
kws5.<yourdomain> | 149.154.171.5 (DC 5) |
kws203.<yourdomain> | 91.105.192.100 (DC 203 / media) |
Prerequisites
- A domain name added to Cloudflare. You can purchase one directly from Cloudflare (Registrar) or transfer an existing domain by updating the nameservers at your current registrar. Any top-level domain works;
.comdomains typically cost around $10–15 per year.
Setup
Add your domain to Cloudflare
Log in to dash.cloudflare.com, click Add a site, enter your domain, and follow the prompts to change your nameservers to Cloudflare’s. Refer to the Cloudflare full setup guide if needed.
Set SSL/TLS mode to Flexible
In the Cloudflare dashboard, navigate to your domain → SSL/TLS → Overview and select Flexible as the encryption mode. This allows Cloudflare to terminate TLS on its edge and forward plain connections to the DC IPs.
Add DNS A records
Go to DNS → Records and click + Add record for each of the following entries. Make sure the Proxy status toggle is orange (proxied) for every record.
| Type | Name | IPv4 address |
|---|---|---|
| A | kws1 | 149.154.175.50 |
| A | kws2 | 149.154.167.51 |
| A | kws3 | 149.154.175.100 |
| A | kws4 | 149.154.167.91 |
| A | kws5 | 149.154.171.5 |
| A | kws203 | 91.105.192.100 |
Configure in TG WS Proxy
Choose the method that matches how you run TG WS Proxy: Tray app — Settings dialog: Open the tray icon menu → Settings, find the CF proxy domain field, and enter your domain (e.g.,yourdomain.com). Click Restart to apply.
CLI flag:
config.json:
