pkg/tlsclientconfig/tlsclientconfig.go
func NewTransport() *http.Transport {
	direct := &net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
		DualStack: true,
	}
	tr := &http.Transport{
		Proxy:               http.ProxyFromEnvironment,
		Dial:                direct.Dial,
		TLSHandshakeTimeout: 10 * time.Second,
		// TODO(dmcgowan): Call close idle connections when complete and use keep alive
		DisableKeepAlives: true,
	}
	proxyDialer, err := sockets.DialerFromEnvironment(direct)
	if err == nil {
		tr.Dial = proxyDialer.Dial
	}
	return tr
}
func NewTransport() *http.Transport {
	direct := &net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
		DualStack: true,
	}
	tr := &http.Transport{
		Proxy:               http.ProxyFromEnvironment,
		Dial:                direct.Dial,
		TLSHandshakeTimeout: 10 * time.Second,
		// TODO(dmcgowan): Call close idle connections when complete and use keep alive
		DisableKeepAlives: true,
	}
	proxyDialer, err := sockets.DialerFromEnvironment(direct)
	if err == nil {
		tr.Dial = proxyDialer.Dial
	}
	return tr
}
func NewTransport ( ) * http . Transport { direct := & net . Dialer { Timeout : 30 * time . Second , KeepAlive : 30 * time . Second , DualStack : true , } tr := & http . Transport { Proxy : http . ProxyFromEnvironment , Dial : direct . Dial , TLSHandshakeTimeout : 10 * time . Second , // TODO(dmcgowan): Call close idle connections when complete and use keep alive DisableKeepAlives : true , } proxyDialer , err := sockets . DialerFromEnvironment ( direct ) if err == nil { tr . Dial = proxyDialer . Dial } return tr }
// NewTransport Creates a default transport
NewTransport Creates a default transport