From 5ea676623889dceb56304ab0653a991b6eeba58f Mon Sep 17 00:00:00 2001 From: Luna Yao <40349250+ZnqbuZ@users.noreply.github.com> Date: Sun, 21 Jun 2026 15:54:07 +0200 Subject: [PATCH] fix: raise max_headers in ws handshake to 128 (#2366) --- Cargo.lock | 3 +-- easytier/Cargo.toml | 2 +- easytier/src/tunnel/websocket.rs | 4 +++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f669f9b..59f33927 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9944,8 +9944,7 @@ dependencies = [ [[package]] name = "tokio-websockets" version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad543404f98bfc969aeb71994105c592acfc6c43323fddcd016bb208d1c65cb" +source = "git+https://github.com/EasyTier/tokio-websockets#dc9771c7c215882349c3cb328877550a3593df21" dependencies = [ "base64 0.22.1", "bytes", diff --git a/easytier/Cargo.toml b/easytier/Cargo.toml index 60f22fcc..15d80243 100644 --- a/easytier/Cargo.toml +++ b/easytier/Cargo.toml @@ -91,7 +91,7 @@ rustls = { version = "0.23.0", features = [ rcgen = { version = "0.12.1", optional = true } # for websocket -tokio-websockets = { version = "0.13.2", optional = true, features = [ +tokio-websockets = { version = "0.13.2", git = "https://github.com/EasyTier/tokio-websockets", optional = true, features = [ "rustls-webpki-roots", "client", "server", diff --git a/easytier/src/tunnel/websocket.rs b/easytier/src/tunnel/websocket.rs index 1992fcfb..d7d1e6ae 100644 --- a/easytier/src/tunnel/websocket.rs +++ b/easytier/src/tunnel/websocket.rs @@ -118,6 +118,7 @@ impl WsTunnelListener { let (request, stream) = ServerBuilder::new() .limits(Limits::unlimited()) + .max_headers(128) .accept(stream) .await?; @@ -252,7 +253,8 @@ impl WsTunnelConnector { ), }; - let c = ClientBuilder::from_uri(http::Uri::try_from(addr.to_string()).unwrap()); + let c = ClientBuilder::from_uri(http::Uri::try_from(addr.to_string()).unwrap()) + .max_headers(128); let stream: MaybeTlsStream = if is_wss { init_crypto_provider(); let tls_conn =