{"id":1072,"date":"2026-10-12T17:37:40","date_gmt":"2026-10-12T14:37:40","guid":{"rendered":"https:\/\/mexela.com\/blog\/http-proxy-https-proxy-no-proxy\/"},"modified":"2026-10-12T20:46:46","modified_gmt":"2026-10-12T17:46:46","slug":"http-proxy-https-proxy-no-proxy","status":"publish","type":"post","link":"https:\/\/mexela.com\/blog\/http-proxy-https-proxy-no-proxy\/","title":{"rendered":"HTTP_PROXY, HTTPS_PROXY and NO_PROXY: Practical Configuration Guide"},"content":{"rendered":"<p class=\"mexela-answer\"><code>HTTP_PROXY<\/code>, <code>HTTPS_PROXY<\/code> and <code>NO_PROXY<\/code> are conventions interpreted by individual clients. Set them in a narrow process scope, check the client&#8217;s case and inheritance rules, and verify both a proxied destination and an intended bypass. An environment value alone does not prove routing.<\/p>\n<p><strong>Reviewed and locally tested: October 12, 2026.<\/strong> Version and route observations below describe the stated test environment. A working local route does not establish a provider&#8217;s public exit, country, anonymity, speed, or uptime.<\/p>\n<h2 id=\"meaning\">Match the variable to the destination request<\/h2>\n<table>\n<thead>\n<tr>\n<th>Variable<\/th>\n<th>Purpose to check in your client<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>http_proxy \/ HTTP_PROXY<\/td>\n<td>Proxy used for an HTTP destination<\/td>\n<\/tr>\n<tr>\n<td>https_proxy \/ HTTPS_PROXY<\/td>\n<td>Proxy used for an HTTPS destination<\/td>\n<\/tr>\n<tr>\n<td>NO_PROXY \/ no_proxy<\/td>\n<td>Destinations that should bypass the configured proxy<\/td>\n<\/tr>\n<tr>\n<td>ALL_PROXY \/ all_proxy<\/td>\n<td>Fallback supported by some clients; inspect it when diagnosing stale settings<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>An HTTPS destination can use an HTTP proxy endpoint: the destination selects the variable, while the URL scheme describes the proxy transport. Bypass syntax is also client-specific. Exact hostnames, suffixes, ports and CIDR ranges are not interchangeable promises across all libraries. Start with one exact test target.<\/p>\n<h2 id=\"scoped\">Use a temporary shell scope<\/h2>\n<pre><code class=\"language-bash\">http_proxy=&quot;$PROXY_URL&quot; https_proxy=&quot;$PROXY_URL&quot; \\\nNO_PROXY=&quot;localhost,127.0.0.1&quot; \\\ncurl --silent --show-error --fail --max-time 8 &quot;$CHECK_URL&quot;<\/code><\/pre>\n<p>Here PROXY_URL and CHECK_URL are supplied securely before the command. The assignments apply to that command rather than permanently changing a login profile. Use an owned or trusted check endpoint. A localhost destination will deliberately bypass this example proxy; choose a non-bypassed endpoint when proving a public route.<\/p>\n<pre><code class=\"language-powershell\">$env:http_proxy = $env:PROXY_URL\n$env:https_proxy = $env:PROXY_URL\n$env:NO_PROXY = &quot;localhost,127.0.0.1&quot;\ncurl.exe --silent --show-error --fail --max-time 8 $env:CHECK_URL<\/code><\/pre>\n<p>The PowerShell values affect that process and its subsequently launched children. Record and restore any pre-existing values afterward; deleting a value is not restoration if another tool had already set it. Use <code>curl.exe<\/code> explicitly so an alias does not change the client being tested. Do not use an environment dump as a diagnostic report because it can disclose credentials.<\/p>\n<h2 id=\"measured\">Measured client differences on Windows<\/h2>\n<p>We ran 25 requests: five configurations across five clients, against an owned HTTP loopback destination and authenticated forward proxy. Python was 3.12.14. The matrix used HTTPX 0.28.1, Requests 2.34.2, aiohttp 3.14.5 and curl 8.21.0. Windows environment variable names are case-insensitive, which changes the meaning of an uppercase\/lowercase comparison.<\/p>\n<p>On narrow screens, scroll this table horizontally to see every configuration.<\/p>\n<div class=\"mexela-decision-table\" id=\"mexela-env-matrix-scroll\" role=\"region\" aria-label=\"Proxy environment observations\" tabindex=\"0\" style=\"max-width:100%;overflow-x:auto\">\n<table style=\"min-width:800px;table-layout:auto\">\n<thead>\n<tr>\n<th>Client<\/th>\n<th>No proxy variable<\/th>\n<th>HTTP_PROXY<\/th>\n<th>http_proxy<\/th>\n<th>Matching NO_PROXY<\/th>\n<th>Nonmatching NO_PROXY<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>HTTPX, environment enabled<\/td>\n<td>Direct<\/td>\n<td>Proxy<\/td>\n<td>Proxy<\/td>\n<td>Direct<\/td>\n<td>Proxy<\/td>\n<\/tr>\n<tr>\n<td>Requests, default environment path<\/td>\n<td>Direct<\/td>\n<td>Proxy<\/td>\n<td>Proxy<\/td>\n<td>Direct<\/td>\n<td>Proxy<\/td>\n<\/tr>\n<tr>\n<td>aiohttp default session<\/td>\n<td>Direct<\/td>\n<td>Direct<\/td>\n<td>Direct<\/td>\n<td>Direct<\/td>\n<td>Direct<\/td>\n<\/tr>\n<tr>\n<td>aiohttp trust_env=True<\/td>\n<td>Direct<\/td>\n<td>Proxy<\/td>\n<td>Proxy<\/td>\n<td>Direct<\/td>\n<td>Proxy<\/td>\n<\/tr>\n<tr>\n<td>Windows curl 8.21.0<\/td>\n<td>Direct<\/td>\n<td>Proxy<\/td>\n<td>Proxy<\/td>\n<td>Direct<\/td>\n<td>Proxy<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>The matching bypass was the exact IPv4 loopback host. These results do not establish arbitrary domain patterns, wildcard portability, HTTPS environment routing, or CIDR behavior for every client. Destination observations identified the actual local socket route and confirmed that proxy authentication was not forwarded downstream.<\/p>\n<h2 id=\"linux\">Linux curl treats HTTP_PROXY differently<\/h2>\n<p>Inside Ubuntu 24.04 under WSL2, curl 8.5.0 used the proxy for lowercase <code>http_proxy<\/code>, but stayed direct with uppercase <code>HTTP_PROXY<\/code> alone. Matching NO_PROXY also stayed direct. Forcing an empty bypass with <code>--noproxy \"\"<\/code> used the proxy again. This is an actual Linux observation, not a conclusion extrapolated from Windows.<\/p>\n<p>The <a href=\"https:\/\/everything.curl.dev\/usingcurl\/proxies\/env.html\">curl environment reference<\/a> explains the special treatment of uppercase HTTP_PROXY. Do not generalize that rule to every variable or to the Windows environment. See <a href=\"\/blog\/wsl2-proxy-setup\/\">the WSL2 guide<\/a> when a command changes behavior across shells.<\/p>\n<h2 id=\"diagnose\">Identify the process that owns the setting<\/h2>\n<p>Write down the executable, version, parent shell and configuration layer before comparing results. A container, CI job, editor extension or child process can receive a different environment. A client with explicit proxy configuration may follow a different path from a library using environment inheritance. Keep your diagnostic request in the exact process that performs the production request.<\/p>\n<p>For Python, compare <a href=\"\/blog\/python-httpx-proxy\/\">explicit HTTPX configuration<\/a> and <a href=\"\/blog\/python-aiohttp-proxy\/\">aiohttp environment trust<\/a>. Their primary references are <a href=\"https:\/\/www.python-httpx.org\/environment_variables\/\">HTTPX environment variables<\/a>, <a href=\"https:\/\/requests.readthedocs.io\/en\/latest\/user\/advanced\/#proxies\">Requests proxies<\/a> and <a href=\"https:\/\/docs.aiohttp.org\/en\/stable\/client_advanced.html#proxy-support\">aiohttp proxy support<\/a>. For other scopes, use <a href=\"\/blog\/docker-proxy-configuration\/\">Docker configuration<\/a>, <a href=\"\/blog\/go-http-proxy\/\">Go transports<\/a> and <a href=\"\/blog\/git-npm-proxy-settings\/\">Git and npm<\/a>; those clients were not part of this measured matrix.<\/p>\n<h2 id=\"faq\">Frequently asked questions<\/h2>\n<div class=\"mexela-faq\">\n<h3>Should NO_PROXY contain * to make troubleshooting easier?<\/h3>\n<p>A broad bypass can defeat the route you intended to test. Use one deliberate target first, verify direct versus proxied behavior, then extend the rule according to that client&#8217;s documented grammar.<\/p>\n<h3>Why does a setting work in Windows but fail in WSL?<\/h3>\n<p>Linux processes have a separate environment and can interpret case differently. Check the variable inside the WSL process and verify the Linux client, rather than assuming Windows shell values were inherited.<\/p>\n<\/div>\n<h2 id=\"next-step\">Verify one client before increasing workload<\/h2>\n<p>Return to <a href=\"\/blog\/proxy-setup-developer-guides\/\">Proxy Setup and Developer Guides<\/a> for adjacent clients. Use <a href=\"\/blog\/test-if-your-proxy-is-working\/\">the proxy verification checklist<\/a> to record a direct baseline and the destination&#8217;s observation. When that is repeatable, compare <a href=\"\/proxy-locations\/\">Mexela proxy locations<\/a> against the actual destination and location requirements.<\/p>\n<p><!-- mexela-developer-kit-20261012:start --><\/p>\n<h2 id=\"developer-examples-download\">Download the developer examples<\/h2>\n<p><a href=\"\/blog\/wp-content\/uploads\/2026\/10\/mexela-developer-examples-20261012-v1.zip\">Download the developer examples ZIP<\/a> for the locally tested Python clients, environment checks, CI route-check files and native PHP cURL helper. The n8n workflow is a separate illustrative reference: it was not imported or executed in n8n. Read the included README for runtime versions, setup and the limits of each check.<\/p>\n<p>ZIP SHA-256: <code>3a43f7d1e6cbb9b2917dbcf88aaa8fe1a2733c33326187cb89c9a9119aad3e20<\/code>. Keep real proxy credentials and destination secrets in your approved secret store; they are absent from this archive. Start with one approved destination and compare its observation with a direct baseline.<\/p>\n<p><!-- mexela-developer-kit-20261012:end --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Compare real proxy environment behavior across HTTPX, Requests, aiohttp, Windows curl and Linux curl, with scoped setup and bypass checks.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[189],"tags":[],"_links":{"self":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts\/1072"}],"collection":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/comments?post=1072"}],"version-history":[{"count":0,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/posts\/1072\/revisions"}],"wp:attachment":[{"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/media?parent=1072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/categories?post=1072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mexela.com\/blog\/wp-json\/wp\/v2\/tags?post=1072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}