Skip to content

Commit

Permalink
unwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
0x676e67 committed Dec 29, 2023
1 parent 98f9e2a commit c7bab93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/proxy/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ impl HttpProxy {
0,
);
socket.bind(bind_addr)?;
Ok(socket.connect(bind_addr).await?)
socket.connect(addr).await
}
(_, Some(IpAddr::V4(v4))) => {
let socket = TcpSocket::new_v4()?;
let bind_addr = SocketAddr::new(IpAddr::V4(v4), 0);
socket.bind(bind_addr)?;
Ok(socket.connect(bind_addr).await?)
socket.connect(addr).await
}
(_, Some(IpAddr::V6(v6))) => {
let socket = TcpSocket::new_v6()?;
let bind_addr = SocketAddr::new(IpAddr::V6(v6), 0);
socket.bind(bind_addr)?;
Ok(socket.connect(bind_addr).await?)
socket.connect(addr).await
}
_ => Ok(TcpStream::connect(addr).await?),
_ => TcpStream::connect(addr).await,
}
}

Expand Down

0 comments on commit c7bab93

Please sign in to comment.