diff --git a/proxy/socks/socks.go b/proxy/socks/socks.go index 98e88ca95..540fb728f 100644 --- a/proxy/socks/socks.go +++ b/proxy/socks/socks.go @@ -7,7 +7,6 @@ import ( "net" "strconv" "sync" - "time" "github.com/v2ray/v2ray-core" "github.com/v2ray/v2ray-core/common/log" @@ -57,10 +56,6 @@ func (server *SocksServer) AcceptConnections(listener net.Listener) { if err != nil { log.Error("Error on accepting socks connection: %v", err) } - if tcpConn, ok := connection.(*net.TCPConn); ok { - tcpConn.SetKeepAlive(true) - tcpConn.SetKeepAlivePeriod(4 * time.Second) - } go server.HandleConnection(connection) } } diff --git a/proxy/vmess/vmessin.go b/proxy/vmess/vmessin.go index 30fc9411c..1a17af32d 100644 --- a/proxy/vmess/vmessin.go +++ b/proxy/vmess/vmessin.go @@ -54,10 +54,6 @@ func (handler *VMessInboundHandler) AcceptConnections(listener net.Listener) err if err != nil { return log.Error("Failed to accpet connection: %s", err.Error()) } - if tcpConn, ok := connection.(*net.TCPConn); ok { - tcpConn.SetKeepAlive(true) - tcpConn.SetKeepAlivePeriod(4 * time.Second) - } go handler.HandleConnection(connection) } return nil