MCPcopy Index your code
hub / github.com/docker/docker-agent / newTransport

Function newTransport

pkg/httpclient/client.go:175–189  ·  view source on GitHub ↗

newTransport returns an HTTP transport with automatic gzip compression disabled and using Docker Desktop proxy if available.

(ctx context.Context)

Source from the content-addressed store, hash-verified

173
174// newTransport returns an HTTP transport with automatic gzip compression disabled and using Docker Desktop proxy if available.
175func newTransport(ctx context.Context) http.RoundTripper {
176 // Get the base transport with Desktop proxy support from remote package
177 rt := remote.NewTransport(ctx)
178
179 // Disable compression for SSE streaming compatibility
180 // Handle both direct *http.Transport and the fallback transport wrapper
181 switch t := rt.(type) {
182 case *http.Transport:
183 t.DisableCompression = true
184 case interface{ DisableCompression() }:
185 t.DisableCompression()
186 }
187
188 return rt
189}
190
191type userAgentTransport struct {
192 httpOptions HTTPOptions

Calls 2

NewTransportFunction · 0.92
DisableCompressionMethod · 0.80