enforce timeout on initial socks5 proxy connection

This commit is contained in:
conduition 2023-12-02 23:25:16 +00:00
parent 5ecb26fd7d
commit d8554fb550
No known key found for this signature in database
GPG Key ID: 78296CED84F6B3C5

View File

@ -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 };