Skip to content

Commit

Permalink
docs(example): Update http_proxy example to use (host, port) (hyperiu…
Browse files Browse the repository at this point in the history
…m#3434)

Signed-off-by: Sven Pfennig <s.pfennig@reply.de>
  • Loading branch information
hatoo authored and 0xE282B0 committed Jan 16, 2024
1 parent db31999 commit 34f7128
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions examples/http_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 34f7128

Please sign in to comment.