Skip to content

Commit

Permalink
Add missing timer to avoid a panic (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
r-vdp authored Aug 16, 2024
1 parent 32da1d6 commit 8da5253
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/tunnel/server/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 8da5253

Please sign in to comment.