dockerclient icon indicating copy to clipboard operation
dockerclient copied to clipboard

Make it possible to supply your own http client

Open rrva opened this issue 10 years ago • 2 comments

rrva avatar Mar 01 '15 13:03 rrva

I don't see why not, but could you please tell us what you are planning to do ?

vieux avatar Mar 02 '15 18:03 vieux

At https://github.com/rrva/docker-devdns I wanted to specify a timeout on all docker operations. Figure this is only sensible to do on read requests, not on write requests (would not want to fire-and-forget a run container command in the same way), but I want to timeout pretty aggressively on ListContainers / InspectContainer requests. I use ResponseHeaderTimeout transport setting on the httpclient for this.

From http://golang.org/src/net/http/transport.go?s=1324:4038#L39

// ResponseHeaderTimeout, if non-zero, specifies the amount of // time to wait for a server's response headers after fully // writing the request (including its body, if any). This // time does not include the time to read the response body. ResponseHeaderTimeout time.Duration // contains filtered or unexported fields

rrva avatar Mar 02 '15 20:03 rrva