A Cloudflare Worker is a fully free alternative to the Cloudflare Proxy domain fallback method. It requires no domain purchase — Cloudflare automatically provides aDocumentation 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.
*.workers.dev subdomain for every Worker you deploy. When configured, TG WS Proxy tries the Worker-based WebSocket path before other fallback methods, making it the preferred option for environments where direct Telegram connections are unreliable.
Prerequisites
- A free Cloudflare account at dash.cloudflare.com. After signing up, confirm your email address using the verification message Cloudflare sends — Workers cannot be deployed until the account email is confirmed.
Before you start, add the following domains to any traffic bypass or unblock software you use (e.g., zapret). If these domains are blocked, the Cloudflare dashboard itself and the Worker editor will not load:
Create the Worker
Open Workers & Pages
Log in to the Cloudflare dashboard. In the left-hand navigation panel, go to Compute → Workers & Pages.
Create a new Worker application
Click the Create application button in the top-right corner. Select Start with Hello World! and click Deploy. Cloudflare provisions the Worker with a placeholder script and assigns it a unique
*.workers.dev domain.Open the code editor
After deploying, click Edit code in the top-right corner of the Worker overview page.
Replace the Worker code
Select and delete all existing code in the editor, then paste in the full Worker script from the Worker code section below.If the editor itself fails to load, you have not yet added the Cloudflare domains to your bypass software (see the note above).
Copy your Worker domain
After deploying, your Worker domain is shown in the panel on the right side of the overview page. It follows the format:Copy this value — you will need it in the next step.
Configure TG WS Proxy
Enter your Worker domain in TG WS Proxy using one of the methods in the Configure in TG WS Proxy section below, then restart the proxy.
Worker code
Paste the following JavaScript into the Cloudflare Worker editor, replacing the default Hello World script entirely./apiws path, opens a raw TCP connection to the Telegram DC IP supplied in the dst query parameter, and bidirectionally relays bytes between the WebSocket client and the TCP socket.
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 Cloudflare Worker domain field, and enter your Worker domain (e.g.,random-name.username.workers.dev). Click Restart to apply.
CLI flag:
config.json:
