fix(web): align relay and bridge with Telegram's published protocol - #429
Merged
Merged
Conversation
sleep3r
marked this pull request as ready for review
September 18, 2026 16:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WEB proxy sessions now follow Telegram's published bridge contract while preserving existing root/dd links. The relay accounts retained allocations, bounds frame batches and closed-stream history, uses expiring carrier tokens, and serves operator-owned public files instead of a hostname-derived placeholder. The browser bridge bounds bytes and outstanding messages, validates its parent, and delivers individual native frames.
The installer preserves client IPs through explicitly trusted HTTP peers, corrects behind-to-mask transitions, suppresses credential URI error logs, and verifies an authenticated MTProto reply before enabling WEB-only. Set
[web].public_dirfor an ordinary website; without it public requests return 404 while WEB links remain functional.Validation: 495 Linux unit tests pass in Debug and ReleaseSafe; 15 browser contract cases, 7 offline HTTPS/WSS setup checks, and 6 WEB integration scenarios pass. A bounded 16-session soak with an 8 MiB buffer budget reduced retained RSS growth from about 30 MiB to 2.6 MiB. All 27 Linux integration scenarios pass, including 10,000 connection churn. The silent-admission fixture now waits for the initial batch to be accounted before testing the next client; this removes a race reproduced on the original main without changing the proxy core.
The Debian 11 test image uses official final-LTS snapshots because the live security repository has removed its packages; package signatures remain mandatory. Other distributions and production APT sources are unchanged. The fixture build, subsequent package installation and snapshot signatures were verified locally.