Created
July 16, 2018 12:54
-
-
Save AKosterin/7af2037b18d252e31662d9cf5e0119de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func initProxyHttpClient(proxyUrl string, insecure bool) *http.Client { | |
pu, _ := url.Parse(proxyUrl) | |
return &http.Client{ | |
Transport: &http.Transport{ | |
Proxy: http.ProxyURL(pu), | |
TLSNextProto: make(map[string]func(authority string, c *tls.Conn) http.RoundTripper), | |
TLSClientConfig: &tls.Config{ | |
InsecureSkipVerify: insecure, | |
}, | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment