MCPcopy
hub / github.com/cloudfoundry/cli / NewConnection

Function NewConnection

api/cfnetworking/networking_connection.go:33–48  ·  view source on GitHub ↗

NewConnection returns a new NetworkingConnection with provided configuration.

(config Config)

Source from the content-addressed store, hash-verified

31// NewConnection returns a new NetworkingConnection with provided
32// configuration.
33func NewConnection(config Config) *NetworkingConnection {
34 tr := &http.Transport{
35 TLSClientConfig: &tls.Config{
36 InsecureSkipVerify: config.SkipSSLValidation,
37 },
38 Proxy: http.ProxyFromEnvironment,
39 DialContext: (&net.Dialer{
40 KeepAlive: 30 * time.Second,
41 Timeout: config.DialTimeout,
42 }).DialContext,
43 }
44
45 return &NetworkingConnection{
46 HTTPClient: &http.Client{Transport: tr},
47 }
48}
49
50// Make performs the request and parses the response.
51func (connection *NetworkingConnection) Make(request *Request, passedResponse *Response) error {

Callers 2

NewClientFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected