Skip to content

Commit

Permalink
enforce timeout on initial socks5 proxy connection
Browse files Browse the repository at this point in the history
  • Loading branch information
conduition committed Dec 2, 2023
1 parent 5ecb26f commit a009e55
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/socks/v5.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ impl Socks5Stream {
TcpStream::connect(proxy)?
};

socket.set_read_timeout(timeout)?;
socket.set_write_timeout(timeout)?;

let target = target.to_target_addr()?;

let packet_len = if auth.is_no_auth() { 3 } else { 4 };
Expand Down

0 comments on commit a009e55

Please sign in to comment.