-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Add http_proxy environment variable support for Windows #29371
Comments
This is part of my current plan. |
This is a redo of PR dotnet#35887. Added support for uppercase HTTP_PROXY and NO_PROXY environment variables. The uppercase versions are being used by Docker and other tools. This now completes the set of environment variables that are already handling both lower and upper case variants. Note: This HttpEnvironmentProxy class is currently only used on Linux and OSX. It is not used on Windows yet. I do plan to add support for this to Windows at a later time, see #37187. Added detection of CGI environments in order to suppress using the uppercase HTTP_PROXY environment variable. See https://httpoxy.org/ Fixed some typos in the CSPROJ of the Http Unit Tests.
This is a redo of PR #35887. Added support for uppercase HTTP_PROXY and NO_PROXY environment variables. The uppercase versions are being used by Docker and other tools. This now completes the set of environment variables that are already handling both lower and upper case variants. Note: This HttpEnvironmentProxy class is currently only used on Linux and OSX. It is not used on Windows yet. I do plan to add support for this to Windows at a later time, see #37187. Added detection of CGI environments in order to suppress using the uppercase HTTP_PROXY environment variable. See https://httpoxy.org/ Fixed some typos in the CSPROJ of the Http Unit Tests.
Changed the Windows version of SocketsHttpHandler so that it will honor the same environment variables similar to the Linux and OSX versions. If the environment variables are not set then it reverts back to the Windows WinInet/IE settings behavior. I added several kinds of unit and end-to-end tests to verify the SystemProxyInfo class is making the correct choice for all the different platforms regarding whether the HttpEnvironmentProxy or platform proxy (HttpSystemProxy for Windows and MacProxy for OSX) is used. Fixes #37187
Changed the Windows version of SocketsHttpHandler so that it will honor the same environment variables similar to the Linux and OSX versions. If the environment variables are not set then it reverts back to the Windows WinInet/IE settings behavior. I added several kinds of unit and end-to-end tests to verify the SystemProxyInfo class is making the correct choice for all the different platforms regarding whether the HttpEnvironmentProxy or platform proxy (HttpSystemProxy for Windows and MacProxy for OSX) is used. Fixes #37187
Changed the Windows version of SocketsHttpHandler so that it will honor the same environment variables similar to the Linux and OSX versions. If the environment variables are not set then it reverts back to the Windows WinInet/IE settings behavior. I added several kinds of unit and end-to-end tests to verify the SystemProxyInfo class is making the correct choice for all the different platforms regarding whether the HttpEnvironmentProxy or platform proxy (HttpSystemProxy for Windows and MacProxy for OSX) is used. Fixes #37187
Changed the Windows version of SocketsHttpHandler so that it will honor the same environment variables similar to the Linux and OSX versions. If the environment variables are not set then it reverts back to the Windows WinInet/IE settings behavior. I added several kinds of unit and end-to-end tests to verify the SystemProxyInfo class is making the correct choice for all the different platforms regarding whether the HttpEnvironmentProxy or platform proxy (HttpSystemProxy for Windows and MacProxy for OSX) is used. Fixes #37187
How can I set the HTTP_PROXY only for a specific .NET Core 3 application? If I set an environment variable there it goes to all other applications too right? Couldn't find any documentation how to set it into appsettings.json as .NET Framework does with Web.config. @davidsh |
@joaoattila you have system-wide envvars, but you also scope it down. e.g. in console:
This will only apply the variable to apps launched from that console. (also, commenting on old closed issues is a gamble because we don't actively monitor things once they're closed -- please open new issues in the future, or ask on Stack Overflow) |
In AnyUnix environments, setting a proxy is as easy as:
Or
export http_proxy=http://localhost:8080 dotnet run
On Windows, I want the same capability:
Unfortunately, that does not work. Here is the test code to explain:
Can you please add support for
http_proxy
environment variables on Windows too and then fall back to the WinINet? I don't want to change my system configuration when I just need to proxy a single app or a fewdotnet run
s.Here is a related issue, but not the same:
The text was updated successfully, but these errors were encountered: