MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / SetProxyIfConfigured

Function SetProxyIfConfigured

internal/net/util.go:327–334  ·  view source on GitHub ↗

SetProxyIfConfigured sets proxy for HTTP Transport if configured

(transport *http.Transport)

Source from the content-addressed store, hash-verified

325
326// SetProxyIfConfigured sets proxy for HTTP Transport if configured
327func SetProxyIfConfigured(transport *http.Transport) {
328 // If proxy address is configured, override environment variable settings
329 if conf.Conf.ProxyAddress != "" {
330 if proxyURL, err := url.Parse(conf.Conf.ProxyAddress); err == nil {
331 transport.Proxy = http.ProxyURL(proxyURL)
332 }
333 }
334}
335
336// SetRestyProxyIfConfigured sets proxy for Resty client if configured
337func SetRestyProxyIfConfigured(client *resty.Client) {

Callers 1

NewHttpClientFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected