From a8111c76f6beb56ec942a1162d15b1523bc8f37e Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 19 Dec 2022 16:27:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E6=94=AF=E6=8C=81CONNECT=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/listener_http.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/nodes/listener_http.go b/internal/nodes/listener_http.go index 93ca5a0..a9a3729 100644 --- a/internal/nodes/listener_http.go +++ b/internal/nodes/listener_http.go @@ -116,6 +116,12 @@ func (this *HTTPListener) Reload(group *serverconfigs.ServerAddressGroup) { // ServerHTTP 处理HTTP请求 func (this *HTTPListener) ServeHTTP(rawWriter http.ResponseWriter, rawReq *http.Request) { + // 不支持Connect + if rawReq.Method == http.MethodConnect { + http.Error(rawWriter, "Method Not Allowed", http.StatusMethodNotAllowed) + return + } + // 域名 var reqHost = strings.TrimRight(rawReq.Host, ".")