Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows Guests not able to download Chef through a proxy #80

Open
lawsonj2019 opened this issue Apr 28, 2014 · 1 comment
Open

Windows Guests not able to download Chef through a proxy #80

lawsonj2019 opened this issue Apr 28, 2014 · 1 comment

Comments

@lawsonj2019
Copy link

I need to be able to bring up a Windows guest that sits behind a corporate proxy. Lucky me. At the moment the omnibus downloader for Windows doesn't allow http_proxy environment variables to be honoured (as far as I can tell).

By changing the powershell command that downloads the omnibus installer from...

powershell -command "(New-Object System.Net.WebClient).DownloadFile('#{url}?v=%version%', '%dest%')"

...to...

powershell -command "$proxy = New-Object System.Net.WebProxy($env:http_proxy); $webclient = New-Object System.Net.WebClient; $webclient.proxy = $proxy; $webclient.DownloadFile('#{url}?v=%version%', '%dest%')"

...I am able to download files through the standard ...install.msi?v=... or through the Vagrantfile install_url config setting or OMNIBUS_INSTALL_URL if I have the http_proxy environment variable set to an appropriate proxy.

Would it be possible to add this to future versions of this plugin?

I've not raised a pull request as some of the proxy functionality appears to be hindered by #74 (which I've also edited as per @williambailey instructions within that issue).

@lawsonj2019
Copy link
Author

With some further testing today I noticed that the commands above did not honour the NO_PROXY settings in case you use the install_url settings to point to a local (non-proxied) location. Here is a revised command that adds the NO_PROXY locations to the download client to allow remote or local downloading...

powershell -command "$proxy = New-Object System.Net.WebProxy($env:HTTP_PROXY,'true',$env:NO_PROXY.Split(',')); $webclient = New-Object System.Net.WebClient; $webclient.proxy = $proxy; $webclient.DownloadFile('#{url}?v=%version%', '%dest%')"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants