From 8da52538bea306036367e0e61f0c4f2ef6ac66f2 Mon Sep 17 00:00:00 2001 From: Ramses Date: Fri, 16 Aug 2024 23:06:21 +0200 Subject: [PATCH] Add missing timer to avoid a panic (#334) --- src/tunnel/server/server.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tunnel/server/server.rs b/src/tunnel/server/server.rs index 567c831..bb87510 100644 --- a/src/tunnel/server/server.rs +++ b/src/tunnel/server/server.rs @@ -18,7 +18,7 @@ use hyper::body::Incoming; use hyper::server::conn::{http1, http2}; use hyper::service::service_fn; use hyper::{http, Request, Response, StatusCode, Version}; -use hyper_util::rt::TokioExecutor; +use hyper_util::rt::{TokioExecutor, TokioTimer}; use once_cell::sync::Lazy; use parking_lot::Mutex; use socket2::SockRef; @@ -436,6 +436,7 @@ impl WsServer { let websocket_upgrade_fn = mk_websocket_upgrade_fn(server, restrictions.clone(), restrict_path, peer_addr); let conn_fut = http1::Builder::new() + .timer(TokioTimer::new()) .header_read_timeout(Duration::from_secs(10)) .serve_connection(tls_stream, service_fn(websocket_upgrade_fn)) .with_upgrades();