From fc7ee875f7efb4694cbcbd53f7d760e925b5841c Mon Sep 17 00:00:00 2001 From: Jason Date: Sun, 11 Aug 2019 22:15:36 +0800 Subject: [PATCH] optimize socks tcp.go --- proxy/socks/tcp.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/proxy/socks/tcp.go b/proxy/socks/tcp.go index 91a5a13..30823ab 100644 --- a/proxy/socks/tcp.go +++ b/proxy/socks/tcp.go @@ -56,8 +56,7 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) { } else { localConn.SetDeadline(time.Now()) remoteConn.SetDeadline(time.Now()) - tcpCloseRead(localConn) - tcpCloseWrite(remoteConn) + tcpCloseRead(remoteConn) } wg.Done() }() @@ -68,8 +67,7 @@ func (h *tcpHandler) relay(localConn, remoteConn net.Conn) { } else { localConn.SetDeadline(time.Now()) remoteConn.SetDeadline(time.Now()) - tcpCloseRead(remoteConn) - tcpCloseWrite(localConn) + tcpCloseRead(localConn) } wg.Wait() // Wait for Up Link done