ToiCF/CF-Workers-TGProxy
基于 Cloudflare Workers 的 Telegram Web/MTProto WebSocket 代理中继,支持 bridge 鉴权、bootstrap/session 令牌、多 lane WS 复用、AES-CTR 加密、自定义帧、流控与严格 CSP。
Older snapshot: check the original source for current information.
From the publisher
README & documentation
Source previewRead the project’s overview, installation instructions and usage examples. The original README is the source of truth.
Cloudflare Workers 的 Telegram Web/MTProto WebSocket 代理中继(KWS Lanes)。 telegramwebproxy.js 是一个单文件 Cloudflare Workers 实现:它扮演 Telegram 官方 Web Proxy(td web-proxy)后端,把客户端(Desktop / Android)在隔离 webview 里发起的 WebSocket lanes,直接转接到 Telegram Web K 自己的 KWS 通道(kws{dc}[-1].web.telegram.org/apiws)。 它不再依赖一套独立的 MTProxy / middle proxy 后端:Worker 在本地解开客户端 MTProto 传输层的 obfuscation,再用自己生成的随机密钥重新封一层,拨 Telegram 官方的 Web K 入口。内层 MTProto 载荷始终由客户端端到端加密,Worker 不接触、也不做 mtp 层加解密。 当前代码主线包含: Telegram 官方的 web-proxy 模型(tproxy)需要一套独立后端:客户端连到本地/自建的服务,再经它转发到远端 MTProxy,链路里多一跳、多一套需要自己运维的加解密中转。 本实现把这一整套换掉: 也就是说,转向 KWS 的关键点是:Worker 只处理传输层,不处理 mtp 层。客户端 MTProto 载荷原样透传,Worker 只对 64 字节 obfuscation 头做一次解、一次重签,再走 Telegram Web K 用的同一入口,边缘可达性与线路质量都直接吃官方域名。 综合到瓶颈场景,理论提升从…
Read the full README ↗ · Preview checked 2026-10-28T13:24:57.462Z
Inside the original README — Document outline
- CF-Workers-TGProxy
- 核心能力
- 代码主路径
- 为什么从官方 MTProto 转向 KWS 转换
- 性能理论上提升多少倍
- 设计重点
- 1. 多 lane 直接替代 Durable Object
- 2. 小包汇聚
- 3. 鉴权与租约
- 4. 页面隔离
- 5. 禁用 WebSocket 压缩协商
- 当前配置
Headings are captured from the source. Links open the publisher’s document, not a locally hosted copy.
Links from the README
References supplied by the publisher, not independently verified endorsements. Check the destination before downloading files or entering credentials.
Documentation belongs to its respective authors. Reported project/model license: GPL-3.0. A listing is not a grant of reuse or training rights. Confirm the document’s own terms at the source.
What this repository does
基于 Cloudflare Workers 的 Telegram Web/MTProto WebSocket 代理中继,支持 bridge 鉴权、bootstrap/session 令牌、多 lane WS 复用、AES-CTR 加密、自定义帧、流控与严格 CSP。
Repository facts
- Owner
- ToiCF
- Primary language
- Not reported
- Stars
- 845
- Forks
- 309
- Open issues + pull requests
- 2
- License
- GPL-3.0
- Archived
- No
- Default branch
- main
- Created
- 2026-10-08T16:38:51.000Z
- Last push
- 2026-10-11T05:21:14.000Z
Topics and intended use
No topics were included in the latest source metadata.
Review the README for scope, installation, examples and limitations. We do not run repository code or certify it.
Evaluate before installing
Review licensing and dependencies, inspect recent commits and unresolved issues, and test in an isolated environment before production use. Stars and forks alone cannot answer these questions.
Source and freshness
Source: GitHub. Metadata observed 2026-10-15T12:08:24.329Z. Daily imports are snapshots, not real-time monitoring.
Popularity and source listings do not establish security, suitability, licensing rights or benchmark performance.