From 4815f378aa9dd7074f561dba863ff68eddf29533 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Sun, 22 Nov 2020 11:52:29 +0800 Subject: [PATCH] =?UTF-8?q?HTTP=E6=9C=8D=E5=8A=A1=E5=A2=9E=E5=8A=A0ReadHea?= =?UTF-8?q?derTimeout=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/listener_http.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/nodes/listener_http.go b/internal/nodes/listener_http.go index e88e155..da1c96f 100644 --- a/internal/nodes/listener_http.go +++ b/internal/nodes/listener_http.go @@ -33,9 +33,10 @@ func (this *HTTPListener) Serve() error { this.isHTTPS = this.Group.IsHTTPS() this.httpServer = &http.Server{ - Addr: this.addr, - Handler: handler, - IdleTimeout: 2 * time.Minute, // TODO IdleTimeout可以设置 + Addr: this.addr, + Handler: handler, + ReadHeaderTimeout: 3 * time.Second, // TODO 改成可以配置 + IdleTimeout: 2 * time.Minute, // TODO 改成可以配置 ConnState: func(conn net.Conn, state http.ConnState) { switch state { case http.StateNew: