NO_PROXY Environment Variable on Mac: Bypass Rules for Dev Tools

Clark
Clark
IPWeb Technical Researcher

On macOS, system proxy settings and shell environment variables can exist at the same time. If a terminal command ignores the GUI proxy, sends localhost through a proxy, or unexpectedly connects directly, check the variables inherited by that exact process.

The key distinction is routing scope. macOS network settings can affect supported applications at the system level, while command-line tools and developer runtimes may read http_proxy, https_proxy, and NO_PROXY from the shell environment instead.

Quick Answer

On macOS, NO_PROXY is a comma-separated bypass list used by many command-line tools and libraries. Add only hosts that should connect directly, such as localhost, loopback addresses, or specific internal domains. Configure the proxy separately with variables such as http_proxy and https_proxy, then verify the route from the same shell and tool. For cURL, http_proxy must be lowercase, while NO_PROXY and no_proxy are both supported.

Key Takeaways
  • NO_PROXY defines bypass exceptions; it does not configure a proxy server by itself.
  • Shell proxy variables and macOS system proxy settings are separate routing layers and may affect different applications.
  • For cURL, use lowercase http_proxy; other proxy variables have different case-handling rules.
  • Keep bypass entries narrow. A broad domain suffix or network range can make requests skip the proxy unexpectedly.
  • Verify the effective route from the same terminal session, runtime, or CI process that will run the workflow.

Why NO_PROXY Matters on Mac

A developer tool may use shell variables even when Safari or another app is following macOS system proxy settings. That difference is why a browser can show the expected route while cURL, a package manager, a build task, or a background process behaves differently.

If you need the macOS GUI path for HTTP, HTTPS, or SOCKS configuration, use the Mac Proxy Settings guide. This workflow stays at the command-line and process-environment layer.

How Proxy Environment Variables Fit Together

http_proxy and https_proxy tell supported tools which proxy endpoint to use. NO_PROXY or no_proxy lists destinations that should connect directly instead.

Case handling is tool-specific. For cURL, http_proxy is intentionally accepted only in lowercase. Other protocol variables can be used in uppercase, and cURL supports both NO_PROXY and no_proxy. See the Everything cURL proxy environment variable documentation for the current matching and case rules.

Environment variables are inherited by processes. If you change them in one terminal tab, an already-running application, another shell, or a CI worker may not receive the same values.

Table 1: macOS system proxy settings and shell proxy variables can affect different request paths.
SettingRoleImportant note
http_proxyProxy endpoint for supported HTTP requestscURL requires the variable name in lowercase
https_proxy / HTTPS_PROXYProxy endpoint for supported HTTPS requestsConfirm which form the specific tool or runtime reads
NO_PROXY / no_proxyDirect-connection exceptionsKeep entries narrow and test the exact client
macOS system proxyNetwork-service proxy configurationDo not assume every command-line tool inherits it
macOS Terminal showing http_proxy, https_proxy, and all_proxy environment variables in zsh
Figure 1: Proxy environment variables can be exported in a macOS zsh session before running command-line tools.

How to Set NO_PROXY on macOS

Set the variables in the terminal session that will run the command. The following example sends supported HTTP and HTTPS requests through one proxy while keeping localhost, loopback addresses, and one internal domain suffix on the direct route.

export http_proxy="http://proxy.example.com:8080"
export https_proxy="http://proxy.example.com:8080"
export NO_PROXY="localhost,127.0.0.1,::1,.internal.example"

Check what the current shell exposes before testing a request:

env | grep -i proxy

To remove the proxy variables from the current shell, unset the forms that may have been defined:

unset http_proxy https_proxy HTTP_PROXY HTTPS_PROXY NO_PROXY no_proxy

If you want the same values in future zsh sessions, add the required export lines to ~/.zshrc, then reload that file with source ~/.zshrc. Keep credentials out of shared repositories and screenshots.

macOS Terminal showing zshrc reload, http_proxy value, and proxy on and off commands
Figure 2: A zsh configuration can load proxy variables for new terminal sessions, so verify the effective values after reloading the file.

What to Put in a NO_PROXY List

Start with destinations that genuinely need a direct route. Common local entries include localhost, 127.0.0.1, and ::1. Add internal hostnames or domains only when those services should not use the proxy.

For cURL, entries are comma-separated. A leading dot can match a domain suffix, so .internal.example can cover hosts below that suffix. cURL also supports CIDR notation in NO_PROXY on current versions, such as 10.0.0.0/8. An entry of * disables proxy use for all hosts, so use it only when a fully direct route is intentional.

Table 2: Example NO_PROXY entries and the direct routes they are intended to match.
EntryTypical purposeReview point
localhostLocal development service by hostnameAlso test the loopback IP if the application may use it
127.0.0.1IPv4 loopbackDoes not automatically cover other local addresses
::1IPv6 loopbackKeep it when local services can resolve over IPv6
.internal.exampleInternal domain suffix in cURL-style matchingA suffix can match more hosts than one exact hostname
10.0.0.0/8Private network range in cURL versions that support CIDRUse only when the entire range should bypass the proxy
macOS Network proxy settings showing 127.0.0.1 in the bypass hosts and domains list
Figure 3: macOS also has a system-level bypass list for direct destinations such as 127.0.0.1; this is separate from shell-level NO_PROXY.

How to Verify the Actual Route

Verify the environment and the route from the same terminal session that runs the workflow. If proxy variables are configured, a public IP endpoint should normally show the proxy exit IP. Temporarily adding that endpoint to NO_PROXY should make the request connect directly instead.

env | grep -i proxy
curl -sS https://api.ipify.org ; echo
NO_PROXY="api.ipify.org" curl -sS https://api.ipify.org ; echo

Compare the two public IP results and keep the proxy host, port, target, and terminal session constant. For a broader validation sequence that also checks location, ASN, protocol, and application scope, use How to Check If a Proxy Is Working.

Different tools can apply different environment-variable and bypass rules, so repeat the verification in the actual client rather than assuming a successful cURL test proves another runtime uses the same route.

macOS Terminal showing curl using the http_proxy environment variable and connecting through 127.0.0.1 port 7890
Figure 4: cURL verbose output can confirm that the current terminal session is using the configured proxy route.

Common Failure Patterns

A local service may fail because it was sent through the proxy. A public API may skip the proxy because a domain suffix or network range is too broad. A CI task may behave differently because it did not inherit the variables from your interactive shell.

Another common mistake is mixing macOS system proxy settings with shell variables and testing in different applications. If Safari follows the system proxy but the terminal has no proxy environment variables, the two requests can legitimately leave through different routes.

Do not copy one tool's environment-variable casing rules to every runtime. For example, Go's net/http proxy handling accepts HTTP_PROXY, HTTPS_PROXY, and NO_PROXY or their lowercase equivalents, while other tools document different conventions. Check the exact client when a route behaves differently.

If the route is configured correctly but the request returns a proxy-authentication error, tunnel error, timeout, or another connection failure, use the Proxy Error guide to classify the failure separately.

Frequently Asked Questions

How do I set NO_PROXY on macOS?
In the terminal session that runs the tool, use an export such as export NO_PROXY="localhost,127.0.0.1,::1,.internal.example". Set the proxy itself separately with the environment variables supported by your client, then verify the route from that same shell.
Is NO_PROXY supported by every Mac app?
No. NO_PROXY is commonly used by command-line tools and libraries, while graphical applications may use macOS system proxy settings or their own configuration. Check the behavior of the exact application.
Should I put localhost in NO_PROXY?
Usually yes when local development servers should connect directly. Test localhost, 127.0.0.1, and ::1 as needed because hostname, IPv4, and IPv6 loopback requests are not always treated identically.
Does NO_PROXY override macOS proxy settings?
Only for tools that read the environment variable and apply it to their own requests. It does not universally change the proxy behavior of every application on macOS.
Why is my API request not using the proxy?
The target may match a NO_PROXY entry, the process may not have inherited your proxy variables, or the client may use its own proxy configuration. Check the current environment and the tool's proxy precedence rules.
Can NO_PROXY fix website access errors?
No. NO_PROXY only controls whether selected destinations bypass a proxy in supported tools. It does not change account requirements, permissions, legal availability, platform policy, or a target server's response rules.
Does NO_PROXY apply to npm, pip, or Homebrew?
Support differs by tool. npm exposes a noproxy setting whose default comes from NO_PROXY. Homebrew documents lowercase no_proxy for downloads performed through tools such as cURL, Git, and SVN. pip can read proxy configuration from environment variables, but its own proxy and configuration options can also affect the request path. Test the same package manager you are troubleshooting instead of assuming a successful cURL test proves the same behavior.

Final Thoughts

Use NO_PROXY when a macOS developer workflow needs selected local or internal destinations to connect directly while other supported requests use a proxy. Keep the list narrow, document each exception, and verify the route from the same shell, runtime, or CI process that sends the real request.

About the author
View all articles
Clark
Clark
IPWeb Technical Researcher

A technical writer specializing in IP proxy services and network architecture. All content is derived from over six years of hands-on experience at a leading IP proxy provider, covering areas such as large-scale proxy network orchestration, optimization of SOCKS5/HTTP protocol stacks, and the dynamics of anti-scraping strategies and countermeasures. The goal is to dissect the engineering logic underpinning network security, stability, and efficiency.

Service areas
Proxy IP network architecture anti-scraping countermeasures protocol optimization for web scraping large-scale data collection engineering

You may be interested in

Claude not available in your country troubleshooting guide with regional availability and location graphics

Why Claude Says It Is Not Available in Your Country

The message “Claude is not available in your country” is easy to misread as a browser problem. It is usually an availability or eligibility decision, and the right next step depends on where it appears. Claude on the web, the mobile app, Claude Code, and the Anthropic API do not share one interchangeable login path. Before changing settings, capture the exact wording, product surface, account used, and time. That short record prevents a country-policy message from being mixed up with an expired session, a managed-account restriction, or a temporary incident. Quick Answer Verify Anthropic's current supported-country information for the specific...

Marcus

Marcus

Proxy Network Analyst

Inspect Element on Mac cover showing Chrome DevTools on a MacBook with Chrome, Safari, and Firefox support

How to Inspect Element on Mac and Check Page Data

On a Mac, you can inspect a webpage in Chrome, Safari, or Firefox from the context menu or with a keyboard shortcut. Opening DevTools is only the first step: the Elements and Network panels can also show whether a visible field is already in the page HTML, added after JavaScript runs, or returned by a separate request. Use the browser and page state that match the task you are checking. A product price, search result, listing, or other public field can appear differently before and after filters, pagination, or client-side rendering. Quick Answer To Inspect Element on a Mac, Control-click...

Ryan

Ryan

IP Proxy Research Team

Mac proxy settings cover showing HTTP, HTTPS, and SOCKS proxy configuration on macOS

How to Set Up and Test Proxies on macOS

A Mac can have several network services: Wi-Fi, Ethernet, USB adapters, VPN interfaces, and other profiles. Proxy settings apply to the selected service, so changing the wrong service can leave your browser or app unchanged. In macOS, open network settings, select the active service, then find the proxy options. Older guides may say Mac OS X, but the practical idea is the same: choose the active network connection before entering proxy details. Quick Answer Mac proxy settings let macOS send supported network traffic through a configured proxy server for a selected network service. The setup is only half the job:...

Clark

Clark

IPWeb Technical Researcher

Ready to scale your data operations?
Join 10,000+ teams using IPWeb to power their web data collection. Start free today.

Strictly anti-abuse

Fraud, automated operation, and unauthorized use are prohibited.

Enterprise-level services

For legitimate commercial and technical use cases only

Risk control and restrictions

Abnormal behavior may trigger service restrictions or termination.

Compliance data use

Data acquisition and use must comply with relevant regulations.

Privacy protection first

The collection or misuse of sensitive personal information is strictly prohibited.

All services are subject to《the Usage Policy》