16 type ProxyFunc func(*http.Request) (*url.URL, error)
17 type DialContextFunc func(ctx context.Context, network, addr string) (net.Conn, error)
19 type NewClientOpts struct {
21 DialContext DialContextFunc
26 func NewClient(url_ *url.URL, opts NewClientOpts) Client {
30 Transport: &http.Transport{
31 DialContext: opts.DialContext,
33 TLSClientConfig: &tls.Config{
34 InsecureSkipVerify: true,
35 ServerName: opts.ServerName,
37 // This is for S3 trackers that hold connections open.
38 DisableKeepAlives: !opts.AllowKeepAlive,
44 func (cl Client) Close() error {
45 cl.hc.CloseIdleConnections()