From 0ca344df5f5ec8b863dbb856971cd01ac8261c16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Tue, 28 Feb 2023 21:16:31 +0800 Subject: [PATCH] Fix uTLS ALPN --- common/tls/utls_client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/common/tls/utls_client.go b/common/tls/utls_client.go index a1836005..97df1f7a 100644 --- a/common/tls/utls_client.go +++ b/common/tls/utls_client.go @@ -14,6 +14,8 @@ import ( "github.com/sagernet/sing-box/option" E "github.com/sagernet/sing/common/exceptions" utls "github.com/sagernet/utls" + + "golang.org/x/net/http2" ) type UTLSClientConfig struct { @@ -34,6 +36,9 @@ func (e *UTLSClientConfig) NextProtos() []string { } func (e *UTLSClientConfig) SetNextProtos(nextProto []string) { + if len(nextProto) == 1 && nextProto[0] == http2.NextProtoTLS { + nextProto = append(nextProto, "http/1.1") + } e.config.NextProtos = nextProto }