Closed mynamewastaken closed 8 years ago
Is there any interest in me opening a PR for this?
Sure! I'm happy to support Windows better, even if I don't plan to test or maintain the functionality myself.
Hi,
I was just going to request this. I'm currently running the following provision script
config.vm.provision "Set Windows Proxy", type: "shell", inline: <<-SHELL
netsh winhttp set proxy (get-item env:http_proxy).Value "$((get-item env:no_proxy).Value)"
write-host Setting Internet Explorer Proxy settings
reg add "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" /v ProxyEnable /t REG_DWORD /d 1 /f
reg add "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" /v ProxyServer /t REG_SZ /d (get-item env:http_proxy).Value /f
reg add "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings" /v ProxyOverride /t REG_SZ /d (get-item env:no_proxy).Value /f
SHELL
Which sets current user (i.e. vagrant) internet settings. I also set the winhttp proxy. Your code looks better although you should set the override value to $env:no_proxy
. I didn't need to strip the http prefix from the proxy url.
@rlaveycal Nice! I'll have to look into that override value. A little swamped at work at the moment, so will likely take me a bit to get to this.
Created a PR: https://github.com/tmatilai/vagrant-proxyconf/pull/143
While vagrant-proxyconf does a great job of setting the various
http_proxy
environment variables, powershell or other native Windows applications don't use those env variables. I ended up writing a PS script that will set the various registry settings to configure the system proxy. Is there any interest in me opening a PR for this? Script is below, it keys off whatever is set forhttp_proxy
.Assumptions are:
http_proxy
envhttp_env
looks something like `http://ip:port/' and doesn't embed credentials (may work with it, but haven't tested)