From 3ba9ee73b943f2d5a4c0784b88850b458c0bcd8b Mon Sep 17 00:00:00 2001 From: V2Ray Date: Wed, 7 Oct 2015 15:24:34 +0200 Subject: [PATCH] Increase reading timeout in favor of long connection --- proxy/socks/socks.go | 2 +- proxy/vmess/vmessin.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/socks/socks.go b/proxy/socks/socks.go index 821f35454..d28c96046 100644 --- a/proxy/socks/socks.go +++ b/proxy/socks/socks.go @@ -57,7 +57,7 @@ func (server *SocksServer) AcceptConnections(listener net.Listener) { func (server *SocksServer) HandleConnection(connection net.Conn) error { defer connection.Close() - reader := v2net.NewTimeOutReader(4, connection) + reader := v2net.NewTimeOutReader(120, connection) auth, auth4, err := protocol.ReadAuthentication(reader) if err != nil && !errors.HasCode(err, 1000) { diff --git a/proxy/vmess/vmessin.go b/proxy/vmess/vmessin.go index a79ca14fa..697e07f8c 100644 --- a/proxy/vmess/vmessin.go +++ b/proxy/vmess/vmessin.go @@ -68,7 +68,7 @@ func (handler *VMessInboundHandler) AcceptConnections(listener net.Listener) err func (handler *VMessInboundHandler) HandleConnection(connection net.Conn) error { defer connection.Close() - connReader := v2net.NewTimeOutReader(4, connection) + connReader := v2net.NewTimeOutReader(120, connection) requestReader := protocol.NewVMessRequestReader(handler.clients) request, err := requestReader.Read(connReader)