From f7c747c511e76ea8e991352a52de6d1b1f4d1a6d Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Mon, 28 Apr 2025 11:28:54 +0800 Subject: [PATCH] :art: Improve online check --- kernel/util/net.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/util/net.go b/kernel/util/net.go index 1b49a83df..fc55bd159 100644 --- a/kernel/util/net.go +++ b/kernel/util/net.go @@ -111,11 +111,13 @@ func IsPortOpen(port string) bool { } func isOnline(checkURL string, skipTlsVerify bool, timeout int) (ret bool) { - c := req.C().SetTimeout(time.Duration(timeout) * time.Millisecond) + c := req.C(). + SetTimeout(time.Duration(timeout) * time.Millisecond). + SetProxy(httpclient.ProxyFromEnvironment). + SetUserAgent(UserAgent) if skipTlsVerify { c.EnableInsecureSkipVerify() } - c.SetUserAgent(UserAgent) for i := 0; i < 2; i++ { resp, err := c.R().Get(checkURL)