MCPcopy
hub / github.com/docker/compose / ProxyTransportFor

Function ProxyTransportFor

internal/desktop/proxy.go:180–187  ·  view source on GitHub ↗

ProxyTransportFor discovers the Docker Desktop endpoint via apiClient and returns the matching transport, or nil when DD is not active or discovery fails (so callers fall back to their own default transport).

(ctx context.Context, apiClient client.APIClient)

Source from the content-addressed store, hash-verified

178// returns the matching transport, or nil when DD is not active or discovery
179// fails (so callers fall back to their own default transport).
180func ProxyTransportFor(ctx context.Context, apiClient client.APIClient) http.RoundTripper {
181 endpoint, err := Endpoint(ctx, apiClient)
182 if err != nil {
183 logrus.Debugf("could not detect Docker Desktop endpoint, deferring to caller's default transport: %v", err)
184 return nil
185 }
186 return ProxyTransport(endpoint)
187}

Callers 2

httpTransportMethod · 0.92
publishMethod · 0.92

Calls 2

EndpointFunction · 0.85
ProxyTransportFunction · 0.85

Tested by

no test coverage detected