17 ProxyFunc func(*http.Request) (*url.URL, error)
18 DialContextFunc func(ctx context.Context, network, addr string) (net.Conn, error)
21 type NewClientOpts struct {
23 DialContext DialContextFunc
28 func NewClient(url_ *url.URL, opts NewClientOpts) Client {
32 Transport: &http.Transport{
33 DialContext: opts.DialContext,
35 TLSClientConfig: &tls.Config{
36 InsecureSkipVerify: true,
37 ServerName: opts.ServerName,
39 // This is for S3 trackers that hold connections open.
40 DisableKeepAlives: !opts.AllowKeepAlive,
46 func (cl Client) Close() error {
47 cl.hc.CloseIdleConnections()