From 6133e5c55145ac1019d74025a5b64fb870ed9e1f Mon Sep 17 00:00:00 2001 From: hatoo Date: Sat, 22 Jun 2024 15:09:50 +0900 Subject: [PATCH] fix dev_proxy --- examples/dev_proxy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dev_proxy.rs b/examples/dev_proxy.rs index aa60d13..7670886 100644 --- a/examples/dev_proxy.rs +++ b/examples/dev_proxy.rs @@ -103,7 +103,7 @@ async fn main() { let original_url = req.uri().clone(); // Forward connection from http/https dev.example to http://127.0.0.1:3333 - if req.uri().host() == Some("dev.example") { + if req.uri().host() == Some("dev.example") && req.method() != hyper::http::Method::CONNECT { req.headers_mut().insert( hyper::header::HOST, hyper::header::HeaderValue::from_maybe_shared(format!("127.0.0.1:{}", port))