From 50b1d39c5c4cf515c2237ae2e2574ea2b708578b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Tue, 23 Dec 2025 21:08:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A6=81=E7=94=A8ipv6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/tools/tools.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/tools/tools.go b/pkg/tools/tools.go index 0e17a022..24e028cf 100644 --- a/pkg/tools/tools.go +++ b/pkg/tools/tools.go @@ -3,6 +3,7 @@ package tools import ( "context" + "crypto/tls" "errors" "fmt" stdnet "net" @@ -94,6 +95,7 @@ func IsChina() bool { client.SetDisableWarn(true) client.SetTimeout(3 * time.Second) client.SetRetryCount(3) + client.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}) resp, err := client.R().Get("https://www.qualcomm.cn/cdn-cgi/trace") if err != nil || !resp.IsSuccess() { @@ -114,6 +116,7 @@ func GetPublicIPv4() (string, error) { client.SetDisableWarn(true) client.SetTimeout(3 * time.Second) client.SetRetryCount(3) + client.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}) client.SetTransport(&http.Transport{ DialContext: func(ctx context.Context, network string, addr string) (stdnet.Conn, error) { return (&stdnet.Dialer{}).DialContext(ctx, "tcp4", addr) @@ -135,6 +138,7 @@ func GetPublicIPv6() (string, error) { client.SetDisableWarn(true) client.SetTimeout(3 * time.Second) client.SetRetryCount(3) + client.SetTLSClientConfig(&tls.Config{InsecureSkipVerify: true}) client.SetTransport(&http.Transport{ DialContext: func(ctx context.Context, network string, addr string) (stdnet.Conn, error) { return (&stdnet.Dialer{}).DialContext(ctx, "tcp6", addr)