driver: Add proxy support

Enable the use of HTTP_PROXY and HTTPS_PROXY variables when downloading
layers
This commit is contained in:
Grégoire Unbekandt 2017-11-07 12:17:13 +01:00
parent e00e57cc2f
commit 5c5857548d

View File

@ -122,6 +122,7 @@ func Extract(format, path string, headers map[string]string, toExtract []string)
// Send the request and handle the response.
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: insecureTLS},
Proxy: http.ProxyFromEnvironment,
}
client := &http.Client{Transport: tr}
r, err := client.Do(request)