Independent Third-Party Guide

TG WS Proxy
A smarter path for Telegram Desktop traffic

TG WS Proxy is a local SOCKS5 proxy. When Telegram DC traffic is detected, it prefers WSS routing via `kws*.web.telegram.org`, and falls back to direct TCP when needed.

Disclaimer: this is a third-party site, not affiliated with Telegram or the project maintainer.

License

MIT License

Build Pipeline

GitHub Actions + PyInstaller

Latest Release

v1.1.1 (2026-03-16)

How It Works

  1. Telegram Desktop connects to local SOCKS5 at `127.0.0.1:1080`.
  2. The proxy identifies Telegram target IPs and extracts DC metadata from MTProto obfuscation init packets.
  3. It prefers TLS WebSocket links to `kws*.web.telegram.org` (protocol `binary`).
  4. MTProto messages are forwarded frame-by-frame to avoid handshake issues from merged packets.
  5. If WS returns 302/redirect-like failures, it automatically downgrades to direct TCP.
Telegram Desktop
  -> SOCKS5 127.0.0.1:1080
  -> TG WS Proxy
  -> WSS kwsN.web.telegram.org (/apiws)
  -> Telegram DC

Desktop-Friendly

Windows has tray GUI support, macOS has app packaging, and CLI mode is also available.

Traffic Strategy

Telegram IP ranges are detected, with routing paths for DC and media/non-media traffic.

Configurable

Supports `--port` and multiple `--dc-ip` entries for network-specific tuning.

Stability Features

Includes pooling, fail cooldown, and fallback logic to reduce reconnect jitter.

Quick Start

1. Download

Get `TgWsProxy.exe` (Windows) or `TgWsProxy.dmg` (macOS) from Releases.

2. Launch Proxy

Default local listener is `127.0.0.1:1080`; tray menu can open Telegram proxy setup directly.

3. Set SOCKS5 in Telegram Desktop

Server `127.0.0.1`, port `1080`, and leave username/password empty.

python proxy/tg_ws_proxy.py --port 1080 \
  --dc-ip 2:149.154.167.220 \
  --dc-ip 4:149.154.167.220 -v

FAQ

Why might acceleration be limited sometimes?

This is a partial optimization approach. Results depend on network routes, region, ISP, and Telegram-side conditions.

Do I need a third-party remote proxy server?

No. It runs as a local process and forwards traffic to Telegram domains/nodes.

What if antivirus flags the binary?

The README mentions potential false positives. Download from official Releases and verify files yourself.

Will this affect Telegram account safety?

It works as a local traffic proxy and does not change your account credentials or Telegram-side authentication model. Still, review source and binaries before use.

Does it log my message content?

The app includes runtime logs for connection/debug status. Treat logs as sensitive operational data and avoid sharing them publicly.

Is Telegram mobile supported?

The project is primarily designed around Telegram Desktop workflows. Mobile support is not its main target.