MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / newWebFetchClient

Function newWebFetchClient

go/engine/node/webfetch.go:52–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50
51// webFetchClient is a process-wide HTTP client with SSRF-safe dialing.
52// Built lazily on first use.
53var webFetchClient = sync.OnceValue(newWebFetchClient)
54
55func newWebFetchClient() *http.Client {
56 dialer := &net.Dialer{Timeout: 10 * time.Second, KeepAlive: 30 * time.Second}
57 transport := &http.Transport{
58 DialContext: safeDialContext(dialer),
59 TLSHandshakeTimeout: 10 * time.Second,
60 ResponseHeaderTimeout: 15 * time.Second,
61 ExpectContinueTimeout: 1 * time.Second,
62 MaxIdleConns: 50,
63 IdleConnTimeout: 90 * time.Second,
64 }
65 return &http.Client{Timeout: webFetchTimeout, Transport: transport}
66}

Callers

nothing calls this directly

Calls 1

safeDialContextFunction · 0.85

Tested by

no test coverage detected