From a009e55095ed6f34d3da2f8319afc6019f4c63ad Mon Sep 17 00:00:00 2001 From: conduition Date: Sat, 2 Dec 2023 23:25:16 +0000 Subject: [PATCH] enforce timeout on initial socks5 proxy connection --- src/socks/v5.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/socks/v5.rs b/src/socks/v5.rs index 50baa6a..5c4b2de 100644 --- a/src/socks/v5.rs +++ b/src/socks/v5.rs @@ -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 };