You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Invoke-WebRequest and Invoke-RestMethod should honor HTTP_Proxy and HTTPS_proxy env vars #3112
As far as I can tell, the web cmdlets never used the system proxy on Windows so having them suddenly start using the system proxy would be a breaking change. Need someone to do a bit more research on this so we don't have a breaking change.
If you have a system proxy (or, more likely a .pac) then all your internet traffic is going through those rules anyway. That is, according to the .pac, it will use a proxy or not as appropriate. To be clear: when I say PowerShell should respect the proxy I don't mean it should use a fixed proxy host, it should respect how the system is configured to use, or not, a proxy. Used properly, I can't see how it would break things: anything you can't access by respecting the proxy, you can't access in Chrome, IE etc.
Ran into a similar issue and ended up defining $env:HTTP_PROXY and $env:HTTPS_PROXY with the URL of http://:@:. This seems to be a quick workaround, at least on my CentOS test box.
Just to clarify, given that the variable names in this issue's title used mixed case: on Unix-like platforms, where case matters, these variables are commonly lowercase (http_proxy, https_proxy).
Activity
cawoodm commentedon Feb 9, 2017
The Windows way is to honour the system proxy in control panel -> internet options -> connections -> LAN settings.
SteveL-MSFT commentedon Feb 9, 2017
The Windows way should already been honored by .Net on Windows
joeyaiello commentedon Feb 9, 2017
Steve Lee (@SteveL-MSFT) Shouldn't the *nix way be honored by .NET as well?
SteveL-MSFT commentedon Feb 9, 2017
Joey Aiello (@joeyaiello) yes, looks like CoreFx supports whatever libcurl supports (https://github.com/dotnet/corefx/issues/11757) so we may just need to also document this
cawoodm commentedon Feb 9, 2017
Invoke-RestMethod was not using my system proxy today (PS5, Win7) I had to use the -Proxy parameter.
SteveL-MSFT commentedon Feb 10, 2017
As far as I can tell, the web cmdlets never used the system proxy on Windows so having them suddenly start using the system proxy would be a breaking change. Need someone to do a bit more research on this so we don't have a breaking change.
cawoodm commentedon Feb 10, 2017
If you have a system proxy (or, more likely a .pac) then all your internet traffic is going through those rules anyway. That is, according to the .pac, it will use a proxy or not as appropriate. To be clear: when I say PowerShell should respect the proxy I don't mean it should use a fixed proxy host, it should respect how the system is configured to use, or not, a proxy. Used properly, I can't see how it would break things: anything you can't access by respecting the proxy, you can't access in Chrome, IE etc.
tibmeister commentedon Feb 16, 2017
Ran into a similar issue and ended up defining $env:HTTP_PROXY and $env:HTTPS_PROXY with the URL of http://:@:. This seems to be a quick workaround, at least on my CentOS test box.
8 remaining items
jakara commentedon May 3, 2018
as native curl and wget is coming to windows, I dont see the behavior of iwr will be changed at all:
curl an wget will honor the unix way, am I right?
markekraus commentedon May 3, 2018
jie.f (@jakara) I will consider possibly adding support for this in iwr and irm for the 6.2.0 release, it's a bit too late in the cycle for 6.1.0.
In the mean time this is a kind of work around that works cross platform:
Add that to your profile or in the initialization of your scripts.
jakara commentedon May 9, 2018
Mark Kraus (@markekraus) that's great!
mklement0 commentedon Oct 16, 2018
Just to clarify, given that the variable names in this issue's title used mixed case: on Unix-like platforms, where case matters, these variables are commonly lowercase (
http_proxy,https_proxy).iSazonov commentedon Jul 16, 2020
This was implemented in .Net 3+ in new HttpClient.
iSazonov commentedon Jul 16, 2020
Sean Wheeler (@sdwheeler) Was this already documented for the web cmdlets?
sdwheeler commentedon Jul 16, 2020
Ilya (@iSazonov) Yes, this is documented.