Repository navigation
Conversation
…equired" Since compatibility date 2026-03-17 Cloudflare delivers binary WebSocket messages as Blob (websocket_standard_binary_type). The message handler accepts only ArrayBuffer and closes every tunnel with 1003. Setting binaryType before accept() restores ArrayBuffer delivery regardless of the compatibility date.
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.
Problem
Workers deployed with a compatibility date of 2026-03-17 or later drop every tunnel immediately. The client log shows:
and TGLock stays on "Ищем новый маршрут" whenever direct routes are blocked.
Cause: starting with compatibility date 2026-03-17 Cloudflare enables the
websocket_standard_binary_typeflag, so binary WebSocket messages are delivered asBlobinstead ofArrayBuffer(changelog). Themessagehandler accepts onlyArrayBuffer/ArrayBuffer.isView, treats theBlobas a non-binary message and closes the socket with 1003.This affects every newly created worker, and existing ones once the compatibility date is bumped (which
docs/CLOUDFLARE_WORKER.mdsuggests forcloudflare:socketserrors).Fix
Set
server.binaryType = "arraybuffer"beforeserver.accept(). Per Cloudflare docs this restoresArrayBufferdelivery regardless of the compatibility flag, so it is safe for both old and new compatibility dates.Testing
tglock-cliwith--worker, ISP blocks directkws*.web.telegram.org(tls handshake eof).Workaround for users who can't update the code: set compatibility date ≤ 2026-03-16 or add the
no_websocket_standard_binary_typecompatibility flag.