enhance: server and nodes analytics

This commit is contained in:
Jacky 2024-11-04 10:44:27 +08:00
parent 3e065f0533
commit 2142f2e1cc
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
8 changed files with 155 additions and 57 deletions

View file

@ -75,7 +75,6 @@ func nodeAnalyticRecord(env *model.Environment, ctx context.Context) (err error)
mutex.Unlock()
u, err := env.GetWebSocketURL("/api/analytic/intro")
if err != nil {
return
}
@ -84,7 +83,12 @@ func nodeAnalyticRecord(env *model.Environment, ctx context.Context) (err error)
header.Set("X-Node-Secret", env.Token)
c, _, err := websocket.DefaultDialer.Dial(u, header)
dial := &websocket.Dialer{
Proxy: http.ProxyFromEnvironment,
HandshakeTimeout: 5 * time.Second,
}
c, _, err := dial.Dial(u, header)
if err != nil {
return
}