Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve online check

Danielf7c747c511e7
diff --git a/kernel/util/net.go b/kernel/util/net.go
index 1b49a83df3..fc55bd159e 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)