Corporate and campus networks often require outbound web traffic to traverse an HTTP proxy, and terminal-based downloads can fail or hang when proxy routing is missing or misconfigured. Centralizing proxy settings for command-line tools keeps automation, scripts, and one-off troubleshooting consistent with enforced network policy.
Many terminal applications on Windows 11 (including curl and wget) honor standard proxy environment variables such as http_proxy and https_proxy. When set, HTTP requests are sent to the proxy directly, while HTTPS traffic is typically tunneled using the CONNECT method so the payload remains end-to-end encrypted.
Proxy variables are scoped to a user profile and the processes launched within it, and changes made with setx only appear in new terminal sessions. Some Windows-native components use the system proxy (WinINet/WinHTTP) instead of these variables, so behavior can vary across tools. Avoid embedding passwords in proxy URLs when possible, since environment values can be exposed to other processes, logs, or diagnostics.
Common no_proxy entries include localhost, 127.0.0.1, and a suffix such as .corp.example.net.
C:\> setx http_proxy http://proxy.example.net:8080 SUCCESS: Specified value was saved. C:\> setx https_proxy http://proxy.example.net:8080 SUCCESS: Specified value was saved. C:\> setx no_proxy localhost,127.0.0.1,.corp.example.net SUCCESS: Specified value was saved.
Most proxies use the same http:// URL for both http_proxy and https_proxy, because HTTPS requests are commonly tunneled through the proxy via CONNECT.
Avoid putting credentials in the proxy URL (for example http://user:pass@proxy:8080) unless required, since the value may be exposed to other processes and logs.
setx writes to the user environment and does not update the already-open terminal session.
C:\> echo %http_proxy% http://proxy.example.net:8080 C:\> echo %https_proxy% http://proxy.example.net:8080 C:\> echo %no_proxy% localhost,127.0.0.1,.corp.example.net
C:\> curl -I -v https://example.com/ * Uses proxy env variable https_proxy == 'http://proxy.example.net:8080' * Trying 192.0.2.10:8080... * Connected to proxy.example.net (192.0.2.10) port 8080 * Establish HTTP proxy tunnel to example.com:443 > CONNECT example.com:443 HTTP/1.1 ##### snipped ##### < HTTP/1.1 200 Connection established ##### snipped ##### HTTP/1.1 200 OK ##### snipped #####
If PowerShell is used for testing, run curl.exe to avoid the built-in curl alias on some PowerShell versions.
C:\> set http_proxy=http://proxy.example.net:8080 C:\> set https_proxy=http://proxy.example.net:8080 C:\> set no_proxy=localhost,127.0.0.1,.corp.example.net
Session values set with set reset when the terminal window closes.
C:\> set http_proxy= C:\> set https_proxy= C:\> set no_proxy=
C:\> setx http_proxy "" SUCCESS: Specified value was saved. C:\> setx https_proxy "" SUCCESS: Specified value was saved. C:\> setx no_proxy "" SUCCESS: Specified value was saved.
Close and reopen the terminal session (or sign out and sign back in) so new processes inherit the cleared values.
C:\> curl -I -v https://example.com/ * Trying 93.184.216.34:443... * Connected to example.com (93.184.216.34) port 443 ##### snipped ##### HTTP/1.1 200 OK ##### snipped #####