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.

Steps to use an HTTP proxy for Windows 11 terminal applications:

  1. Record the proxy URL in the form http://proxy.example.net:8080 and an optional bypass list for internal hosts.

    Common no_proxy entries include localhost, 127.0.0.1, and a suffix such as .corp.example.net.

  2. Open Command Prompt.
  3. Save persistent proxy environment variables with setx.
    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.

  4. Close and reopen Command Prompt to load the persistent variables.

    setx writes to the user environment and does not update the already-open terminal session.

  5. Verify the proxy variables in the new 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
  6. Make a test request with curl and confirm the proxy tunnel is used.
    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.

  7. Override proxy values for the current terminal window with set when persistence is not desired.
    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.

  8. Remove the proxy variables from the current terminal session to stop proxy routing immediately.
    C:\> set http_proxy=
    C:\> set https_proxy=
    C:\> set no_proxy=
  9. Clear the persistent proxy variables when proxy routing is no longer required.
    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.

  10. Confirm the environment variables no longer direct traffic through the proxy.
    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 #####