mirror of
https://github.com/by-sonic/tglock.git
synced 2026-11-05 07:11:56 +03:00
9529df3fdf
* worker: set binaryType = "arraybuffer" to fix 1003 "binary messages required" 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. * fix(worker): accept Blob frames and name an outdated Worker in the log; 2.0.0-beta.16 Since compatibility date 2026-03-17 Cloudflare delivers binary WebSocket frames as Blob unless binaryType is "arraybuffer", and the Worker closed every tunnel with 1003 right after the handshake. wrangler.toml itself pins 2026-09-19, so every fresh deployment was broken (#58, #50, #53). On top of #61 (binaryType before accept) the Worker now also relays Blob frames in order, and the client log tells the user to redeploy the script when a Worker closes with "1003 binary messages required". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Dmitry Sankevich <16187308+avost@users.noreply.github.com> Co-authored-by: babin <Thartewerner536e@engineer.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
79 lines
2.7 KiB
TOML
79 lines
2.7 KiB
TOML
[package]
|
|
name = "tglock"
|
|
version = "2.0.0-beta.16"
|
|
edition = "2021"
|
|
rust-version = "1.88"
|
|
description = "Telegram unblock via local WebSocket tunnel"
|
|
license = "MIT"
|
|
autobins = false
|
|
|
|
[features]
|
|
default = ["gui"]
|
|
# The desktop GUI. Turning it off drops Tauri, the system WebView and the
|
|
# frontend bundle from the build, which is what makes headless servers and
|
|
# machines without a GPU or monitor able to build and run TGLock at all.
|
|
gui = ["dep:tauri", "dep:tauri-build", "dep:tauri-plugin-opener"]
|
|
# The headless binary. Deliberately NOT in `default`.
|
|
#
|
|
# When both binaries exist in one build, the Tauri bundler picks the wrong one
|
|
# as the application: `tauri build --target <triple>` packaged tglock-cli and
|
|
# shipped it as the app in v2.0.0-beta.2 and v2.0.0-beta.3. Keeping the CLI
|
|
# behind its own non-default feature means it simply does not exist during an
|
|
# application build, so there is nothing to pick wrongly.
|
|
cli = ["dep:clap", "dep:toml"]
|
|
|
|
[lib]
|
|
name = "tglock_lib"
|
|
path = "src/lib.rs"
|
|
crate-type = ["staticlib", "cdylib", "rlib"]
|
|
|
|
[[bin]]
|
|
name = "tglock"
|
|
path = "src/main.rs"
|
|
required-features = ["gui"]
|
|
|
|
[[bin]]
|
|
name = "tglock-cli"
|
|
path = "src/bin/cli.rs"
|
|
required-features = ["cli"]
|
|
|
|
[dependencies]
|
|
tauri = { version = "2", features = [], optional = true }
|
|
tauri-plugin-opener = { version = "2", optional = true }
|
|
clap = { version = "4", features = ["derive"], optional = true }
|
|
# Файл конфигурации CLI. TOML, а не JSON, потому что файл правят руками и в нём
|
|
# нужны комментарии.
|
|
toml = { version = "0.8", optional = true }
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
tokio = { version = "1", features = [
|
|
"rt-multi-thread",
|
|
"net",
|
|
"io-util",
|
|
"time",
|
|
"macros",
|
|
"sync",
|
|
"signal",
|
|
] }
|
|
tokio-tungstenite = { version = "0.24", features = ["rustls-tls-webpki-roots"] }
|
|
# Explicit ring provider supports Android and static musl without OpenSSL.
|
|
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "tls12"] }
|
|
webpki-roots = "0.26"
|
|
futures-util = "0.3"
|
|
aes = "0.8"
|
|
ctr = "0.9"
|
|
cipher = "0.4"
|
|
sha2 = "0.10"
|
|
rand = "0.8"
|
|
|
|
[build-dependencies]
|
|
tauri-build = { version = "2", features = [], optional = true }
|
|
|
|
[dev-dependencies]
|
|
rcgen = "0.13"
|
|
tokio-rustls = { version = "0.26", default-features = false, features = ["ring", "tls12"] }
|
|
# `start_paused` в тестах: таймаут ожидания запроса от клиента — десять секунд,
|
|
# и ждать их по-настоящему в тесте нельзя. В сборку не попадает: dev-зависимости
|
|
# участвуют только в тестах.
|
|
tokio = { version = "1", features = ["test-util"] }
|