Configuring an HTTP proxy for command-line tools in Windows is vital in environments with restricted internet access or strict routing policies. It ensures applications like curl and wget always funnel requests through the specified proxy, maintaining reliable connections and adhering to network rules.
Environment variables offer a direct way to set proxy configurations system-wide on Windows. Recognizing these variables allows PowerShell, Command Prompt, and other terminal-based tools to apply uniform network settings, reducing per-application overhead and minimizing errors.
Reliable proxy management remains crucial for IT professionals who handle complex enterprise environments. Consistent application of HTTP and HTTPS proxies saves time, avoids manual configuration, and contributes to an organized, policy-compliant network infrastructure.
Steps to use http proxy for Windows 11 terminal applications:
- Ensure a functioning HTTP proxy or server is available.
- Open Command Prompt or PowerShell.
- Define the HTTP proxy by setting the http_proxy environment variable with the server address and port.
# setx http_proxy http://proxyserver:8080 SUCCESS: Specified value was saved.
- Define the HTTPS proxy by setting the https_proxy environment variable with the secure proxy server address and port.
# setx https_proxy https://proxyserver:8080 SUCCESS: Specified value was saved.
- Verify the proxy configuration by echoing the environment variables.
# echo %http_proxy% http://proxyserver:8080
- Test the settings using a command-line tool like curl.
# curl http://example.com [Output showing connection through proxyserver]
- For temporary session-based proxy settings, use set instead of setx.
# set http_proxy=http://proxyserver:8080
Use setx for persistent user-level variables in Windows, and set for variables that revert after closing the session.
- Remove proxy settings by clearing the environment variables.
# setx http_proxy "" SUCCESS: Specified value was saved. # setx https_proxy "" SUCCESS: Specified value was saved.
Restart the terminal session or log off and on again to ensure changes to environment variables take effect.

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
Comment anonymously. Login not required.