NewConnection returns a new PluginConnection
(skipSSLValidation bool, dialTimeout time.Duration)
| 23 | |
| 24 | // NewConnection returns a new PluginConnection |
| 25 | func NewConnection(skipSSLValidation bool, dialTimeout time.Duration) *PluginConnection { |
| 26 | tr := &http.Transport{ |
| 27 | TLSClientConfig: util.NewTLSConfig(nil, skipSSLValidation), |
| 28 | Proxy: http.ProxyFromEnvironment, |
| 29 | DialContext: (&net.Dialer{ |
| 30 | KeepAlive: 30 * time.Second, |
| 31 | Timeout: dialTimeout, |
| 32 | }).DialContext, |
| 33 | } |
| 34 | |
| 35 | return &PluginConnection{ |
| 36 | HTTPClient: &http.Client{Transport: tr}, |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | // Make performs the request and parses the response. |
| 41 | func (connection *PluginConnection) Make(request *http.Request, passedResponse *Response, proxyReader ProxyReader) error { |
no test coverage detected