From 4e30ac33d0c418c9bd05cc358bab7997238d800a Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Tue, 21 Aug 2018 23:09:45 +0200 Subject: [PATCH] reduce delay on passive connections --- app/proxyman/mux/mux.go | 2 +- proxy/vmess/outbound/outbound.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/proxyman/mux/mux.go b/app/proxyman/mux/mux.go index ef4e1549..9cb039d3 100644 --- a/app/proxyman/mux/mux.go +++ b/app/proxyman/mux/mux.go @@ -147,7 +147,7 @@ func (m *Client) monitor() { } func writeFirstPayload(reader buf.Reader, writer *Writer) error { - err := buf.CopyOnceTimeout(reader, writer, time.Millisecond*200) + err := buf.CopyOnceTimeout(reader, writer, time.Millisecond*100) if err == buf.ErrNotTimeoutReader || err == buf.ErrReadTimeout { return writer.WriteMultiBuffer(buf.MultiBuffer{}) } diff --git a/proxy/vmess/outbound/outbound.go b/proxy/vmess/outbound/outbound.go index ce6bd773..3801afdb 100644 --- a/proxy/vmess/outbound/outbound.go +++ b/proxy/vmess/outbound/outbound.go @@ -120,7 +120,7 @@ func (v *Handler) Process(ctx context.Context, link *core.Link, dialer proxy.Dia } bodyWriter := session.EncodeRequestBody(request, writer) - if err := buf.CopyOnceTimeout(input, bodyWriter, time.Millisecond*500); err != nil && err != buf.ErrNotTimeoutReader && err != buf.ErrReadTimeout { + if err := buf.CopyOnceTimeout(input, bodyWriter, time.Millisecond*100); err != nil && err != buf.ErrNotTimeoutReader && err != buf.ErrReadTimeout { return newError("failed to write first payload").Base(err) }