consumer/consumer.go
func New(trafficControllerUrl string, tlsConfig *tls.Config, proxy func(*http.Request) (*url.URL, error)) *Consumer {
	if proxy == nil {
		proxy = http.ProxyFromEnvironment
	}

	return &Consumer{
		trafficControllerUrl: trafficControllerUrl,
		debugPrinter:         nullDebugPrinter{},
		client: &http.Client{
			Transport: &http.Transport{
				Proxy:               proxy,
				TLSClientConfig:     tlsConfig,
				TLSHandshakeTimeout: internal.Timeout,
				DisableKeepAlives:   true,
			},
			Timeout: internal.Timeout,
		},
		minRetryDelay: int64(DefaultMinRetryDelay),
		maxRetryDelay: int64(DefaultMaxRetryDelay),
		maxRetryCount: int64(DefaultMaxRetryCount),
		dialer: websocket.Dialer{
			HandshakeTimeout: internal.Timeout,
			Proxy:            proxy,
			TLSClientConfig:  tlsConfig,
		},
		recentPathBuilder: defaultRecentPathBuilder,
		streamPathBuilder: defaultStreamPathBuilder,
	}
}
func New(trafficControllerUrl string, tlsConfig *tls.Config, proxy func(*http.Request) (*url.URL, error)) *Consumer {
	if proxy == nil {
		proxy = http.ProxyFromEnvironment
	}

	return &Consumer{
		trafficControllerUrl: trafficControllerUrl,
		debugPrinter:         nullDebugPrinter{},
		client: &http.Client{
			Transport: &http.Transport{
				Proxy:               proxy,
				TLSClientConfig:     tlsConfig,
				TLSHandshakeTimeout: internal.Timeout,
				DisableKeepAlives:   true,
			},
			Timeout: internal.Timeout,
		},
		minRetryDelay: int64(DefaultMinRetryDelay),
		maxRetryDelay: int64(DefaultMaxRetryDelay),
		maxRetryCount: int64(DefaultMaxRetryCount),
		dialer: websocket.Dialer{
			HandshakeTimeout: internal.Timeout,
			Proxy:            proxy,
			TLSClientConfig:  tlsConfig,
		},
		recentPathBuilder: defaultRecentPathBuilder,
		streamPathBuilder: defaultStreamPathBuilder,
	}
}
func New ( trafficControllerUrl string , tlsConfig * tls . Config , proxy func ( * http . Request ) ( * url . URL , error ) ) * Consumer { if proxy == nil { proxy = http . ProxyFromEnvironment } return & Consumer { trafficControllerUrl : trafficControllerUrl , debugPrinter : nullDebugPrinter { } , client : & http . Client { Transport : & http . Transport { Proxy : proxy , TLSClientConfig : tlsConfig , TLSHandshakeTimeout : internal . Timeout , DisableKeepAlives : true , } , Timeout : internal . Timeout , } , minRetryDelay : int64 ( DefaultMinRetryDelay ) , maxRetryDelay : int64 ( DefaultMaxRetryDelay ) , maxRetryCount : int64 ( DefaultMaxRetryCount ) , dialer : websocket . Dialer { HandshakeTimeout : internal . Timeout , Proxy : proxy , TLSClientConfig : tlsConfig , } , recentPathBuilder : defaultRecentPathBuilder , streamPathBuilder : defaultStreamPathBuilder , } }
// New creates a new consumer to a trafficcontroller.
New creates a new consumer to a trafficcontroller .