diff --git a/CHANGELOG.md b/CHANGELOG.md index ab587526e..5c8b509c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,9 @@ ## 0.3.3 (unreleased) +IMPROVEMENTS: +* core: All HTTP downloads across Packer now support the standard + proxy environmental variables (`HTTP_PROXY`, `NO_PROXY`, etc.) [GH-252] ## 0.3.2 (August 18, 2013) diff --git a/common/download.go b/common/download.go index a70a1485c..fb34c7965 100644 --- a/common/download.go +++ b/common/download.go @@ -188,7 +188,18 @@ func (*HTTPDownloader) Cancel() { func (d *HTTPDownloader) Download(dst io.Writer, src *url.URL) error { log.Printf("Starting download: %s", src.String()) - resp, err := http.Get(src.String()) + req, err := http.NewRequest("GET", src.String(), nil) + if err != nil { + return err + } + + httpClient := &http.Client{ + Transport: &http.Transport{ + Proxy: http.ProxyFromEnvironment, + }, + } + + resp, err := httpClient.Do(req) if err != nil { return err }