From b8444c4f6c5dd45587365c73bf16db3950f31d9c Mon Sep 17 00:00:00 2001 From: Michael Zhou Date: Sat, 15 Jan 2022 17:36:11 +1100 Subject: [PATCH] enable tcp_nodelay on server --- src/server.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/server.rs b/src/server.rs index 6bd5058..5cdeaec 100644 --- a/src/server.rs +++ b/src/server.rs @@ -160,6 +160,10 @@ impl<'a> Stream for Incoming<'a> { &peer_addr, &local_addr ); + debug!("incoming nodelay is {:?}", socket.nodelay()); + let _ = socket.set_nodelay(true); + debug!("incoming nodelay is {:?}", socket.nodelay()); + // Wrap the TcpStream into Socks5Socket let socket = Socks5Socket::new(socket, self.0.config.clone()); @@ -529,6 +533,10 @@ impl Socks5Socket { debug!("Connected to remote destination"); + debug!("outbound nodelay is {:?}", outbound.nodelay()); + let _ = outbound.set_nodelay(true); + debug!("outbound nodelay is {:?}", outbound.nodelay()); + // TODO: convert this to the real address self.inner .write(&[