From 1423b90ae5cf6f5bcf1539fa6e94ec360802369a Mon Sep 17 00:00:00 2001 From: yaott Date: Thu, 13 Oct 2022 12:52:18 +0800 Subject: [PATCH] update utls to v1.1.3 and support more tls fingerprints --- common/tls/utls_client.go | 12 +++++++++++- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/common/tls/utls_client.go b/common/tls/utls_client.go index b3b91970..40eb08b4 100644 --- a/common/tls/utls_client.go +++ b/common/tls/utls_client.go @@ -136,7 +136,7 @@ func newUTLSClient(router adapter.Router, serverAddress string, options option.O } var id utls.ClientHelloID switch options.UTLS.Fingerprint { - case "chrome", "": + case "chrome": id = utls.HelloChrome_Auto case "firefox": id = utls.HelloFirefox_Auto @@ -144,8 +144,18 @@ func newUTLSClient(router adapter.Router, serverAddress string, options option.O id = utls.HelloIOS_Auto case "android": id = utls.HelloAndroid_11_OkHttp + case "edge": + id = utls.HelloEdge_Auto + case "safari": + id = utls.HelloSafari_Auto + case "360": + id = utls.Hello360_Auto + case "qq": + id = utls.HelloQQ_Auto case "random": id = utls.HelloRandomized + default: + id = utls.HelloChrome_Auto } return &utlsClientConfig{&tlsConfig, id}, nil } diff --git a/go.mod b/go.mod index 5a407967..7ad3d9ec 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/miekg/dns v1.1.50 github.com/oschwald/maxminddb-golang v1.10.0 github.com/pires/go-proxyproto v0.6.2 - github.com/refraction-networking/utls v1.1.2 + github.com/refraction-networking/utls v1.1.3 github.com/sagernet/quic-go v0.0.0-20220818150011-de611ab3e2bb github.com/sagernet/sing v0.0.0-20221006081821-c4e9bf11fa00 github.com/sagernet/sing-dns v0.0.0-20220929010544-ee843807aae3 diff --git a/go.sum b/go.sum index 80c39b64..ee386c05 100644 --- a/go.sum +++ b/go.sum @@ -131,8 +131,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/refraction-networking/utls v1.1.2 h1:a7GQauRt72VG+wtNm0lnrAaCGlyX47gEi1++dSsDBpw= -github.com/refraction-networking/utls v1.1.2/go.mod h1:+D89TUtA8+NKVFj1IXWr0p3tSdX1+SqUB7rL0QnGqyg= +github.com/refraction-networking/utls v1.1.3 h1:K9opY+iKxcGvHOBG2019wFEVtsNFh0f5WqHyc2i3iU0= +github.com/refraction-networking/utls v1.1.3/go.mod h1:+D89TUtA8+NKVFj1IXWr0p3tSdX1+SqUB7rL0QnGqyg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sagernet/abx-go v0.0.0-20220819185957-dba1257d738e h1:5CFRo8FJbCuf5s/eTBdZpmMbn8Fe2eSMLNAYfKanA34=