From abf696aadbb1838a8ee8a952f0e9f913f0bd4872 Mon Sep 17 00:00:00 2001 From: hatoo Date: Tue, 21 Nov 2023 23:58:26 +0900 Subject: [PATCH] docs(example): Update http_proxy example to use (host, port) (#3434) --- examples/http_proxy.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/http_proxy.rs b/examples/http_proxy.rs index c36cc23778..2dbc5c9ac7 100644 --- a/examples/http_proxy.rs +++ b/examples/http_proxy.rs @@ -90,9 +90,8 @@ async fn proxy( } else { let host = req.uri().host().expect("uri has no host"); let port = req.uri().port_u16().unwrap_or(80); - let addr = format!("{}:{}", host, port); - let stream = TcpStream::connect(addr).await.unwrap(); + let stream = TcpStream::connect((host, port)).await.unwrap(); let io = TokioIo::new(stream); let (mut sender, conn) = Builder::new()