From 6d5c904f12c622806e61d8709600c97ceeb32fac Mon Sep 17 00:00:00 2001 From: Jun Kurihara Date: Wed, 6 Jul 2022 14:13:55 +0900 Subject: [PATCH] fix upgrade for http1.1 and 2 --- src/proxy/proxy_main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/proxy/proxy_main.rs b/src/proxy/proxy_main.rs index 1a8c707..22434d5 100644 --- a/src/proxy/proxy_main.rs +++ b/src/proxy/proxy_main.rs @@ -61,10 +61,12 @@ where self.globals.runtime_handle.clone().spawn(async move { tokio::time::timeout( self.globals.timeout + Duration::from_secs(1), - server.serve_connection( - stream, - service_fn(move |req: Request| self.clone().handle_request(req, peer_addr)), - ), + server + .serve_connection( + stream, + service_fn(move |req: Request| self.clone().handle_request(req, peer_addr)), + ) + .with_upgrades(), ) .await .ok();