TG WS Proxy
io.github.valnesfjord.tgwsproxyrs
Zapstore _@zapstore.dev Telegram MTProto WebSocket Bridge Proxy
Republished from GitHub / F-Droid by the Zapstore main account.
**Telegram MTProto WebSocket Bridge Proxy** — a Rust **vibecoded** port of [Flowseal/tg-ws-proxy](https://github.com/Flowseal/tg-ws-proxy). Listens for Telegram Desktop's MTProto connections on a local port and tunnels them through WebSocket (TLS) connections to Telegram's DC servers. Telegram channel: [@tgwsproxy_rs](https://t.me/tg_ws_proxy_rs). Telegram Desktop → MTProto (TCP 1443) → tg-ws-proxy-rs → WS (TLS 443) → Telegram DC ↘ CF proxy (kws{N}.{cf-domain}) → Telegram DC (WS via Cloudflare) ↘ CF Worker (*.workers.dev) → Telegram DC (TCP tunnel via Cloudflare) ↘ upstream MTProto proxy → Telegram DC (WS fallback) ↘ direct TCP :443 → Telegram DC (last resort) Android app A minimal Jetpack Compose wrapper around the same core the CLI runs. Type the flags you would pass to tg-ws-proxy, tap **Start**, and when the tg://proxy link appears tap it (or let the app open it) to add the proxy in Telegram. The listen address should be 127.0.0.1 so Telegram on the same phone can connect. Add --secret <32 hex chars> if you want the link to stay the same across restarts. --log-file is ignored; logs go to the on-screen view and logcat (tg-ws-proxy). The default arguments carry --quiet, so the on-screen **Log** panel stays empty until you remove it. That is the default and not a failed start: drop --quiet (or swap it for --verbose) before tapping **Start** to see log lines. The tg:// link appears either way — it reaches the UI from the listen callback rather than by scraping the log, so --quiet never hides it.
First release: Oct 2, 2026, 6 total releases.
Most recent release: Nov 2, 2026.
Appears in 0 app stacks.
0 sats / 0 zaps received in the past year.
Sats Received
Underlying data available via MCP: app_zaps, app_releases.
Zap Count
Underlying data available via MCP: app_zaps, app_releases.
Releases
- Nov 2, 2026 2.6.0## Optional Telegram SOCKS5 input (#137) - Add a separate, opt-in SOCKS5 CONNECT listener (loopback port 1080 by default), alongside the existing MTProto/FakeTLS listener, with a shared connection budget. - Bridge plain and secretless-obfuscated abridged/intermediate/padded MTProto to the existing WSS/Cloudflare/upstream/TCP fallback ladder and pool. - Resolve client destinations using exact Telegram DC mappings: common IPv4 DC and media endpoints plus the IPv6 DC1–5 addresses built into the official clients, with explicit signed DC:IP mappings on top. An address in neither but inside Telegram's published ranges is routed by the DC the client's
More…
obfuscated header names, as Telegram Desktop always does, so new media addresses keep loading. One whose header names none is closed with a warning that media will not load. Addresses outside Telegram, arbitrary hostnames and UDP/BIND are refused. Each outcome is logged once per address; repeated rejections go to debug level. - Add an OpenWrt LuCI switch, listener settings and DC mappings, plus English and Russian Forkop setup guides linked from README. - LuCI shows each listener's connection links with a Copy button: the MTProto `tg://proxy` link per secret, and for SOCKS5 a `socks5://` URL for router services plus a `tg://socks` link when it is reachable from the LAN. They come from the new `--print-links`, so LuCI and the startup banner agree. This input has no authentication and is intended for a local routing service or trusted LAN. It is not a generic web proxy, TUN interface, or UDP calling tunnel. - Nov 1, 2026 2.5.12On Entware routers (Keenetic and others), a proxy started by hand no longer dies when the terminal session that started it closes. ## Fixed ### The Entware service survives SIGHUP (#164) The Entware init script started the proxy as a plain background job of the shell that ran it. Run from boot, that shell has no terminal, and nothing happens. But a `start` or `restart` typed over SSH or telnet leaves the proxy inside that login session, and when the session closes (logging out, a
More…
dropped connection, the client device rebooting), the kernel sends every process in it SIGHUP. The proxy does not handle SIGHUP, so it exited, and stayed down until the next manual start or reboot. - The init script now starts the proxy with SIGHUP ignored. An ignored signal stays ignored across `exec`, so the proxy itself never sees the hangup. - This uses the shell's own `trap`. `nohup` and `setsid` are not guaranteed in the firmware's BusyBox. - OpenWrt is unaffected: procd starts the service in its own session. **The fix lands when the init script is rewritten**, which the installer does on every install and upgrade. Running the installer again (or updating as usual) is enough. The `sed` workaround from #164 is no longer needed and is overwritten. Thanks to @Kor-Phaeron for the report and the workaround it is based on. ## Also - rustls 0.23.45 → 0.23.46, a patch release: TLS 1.3 traffic keys are now updated within fragmented writes too, a session secret is no longer printed by its `Debug` output, and buffering received plaintext applies backpressure (#165). ## What it costs Nothing. `stop` still works: it sends SIGTERM and, if that is not enough, SIGKILL, neither of which is affected. - Oct 30, 2026 2.5.10With `--cf-balance`, the connection pool's spare Cloudflare-proxy connections are dialled at the `kws{N}` record, not at the bare `--cf-domain`. ## Fixed ### `--cf-balance` sent every pool spare to the zone apex (#161) After a Cloudflare-proxy connection succeeds, the pool opens a spare through one domain. Without `--cf-balance` that is the record that just answered, `kws{N}.your-domain`. With `--cf-balance` the pool takes the next domain in the rotation instead, so the spares follow the balancing. But the
More…
rotation holds bare domains, and the pool dialled the pick as is: `your-domain`, with no `kws{N}.` in front. The zone apex has no DNS record, so Cloudflare answered 530 and the spare was never opened. Clients were not cut off: the connection that triggered the spare had already succeeded. But every balanced spare failed, so the pool never helped, and every connection paid the full Cloudflare handshake inline. In the reporter's Cloudflare analytics, exactly half of the `/apiws` requests were failing 530s on the bare domain. - The pool now dials the `kws{N}` record of the domain it picks from the rotation, the same name the inline path uses. - Cloudflare Worker spares are unchanged. A Worker is dialled at its own hostname, which is what the rotation holds for it. Thanks to @UjuiUjuMandan for tracking this down. ## What it costs Nothing. The spare now reaches a record that exists, and `--cf-balance` works for the pool as intended. - Oct 22, 2026 2.5.6
- Oct 14, 2026 2.5.4
- Oct 2, 2026 2.5.0