· Troubleshooting · 8 min read

macOS system proxy is enabled but not working: troubleshoot Safari, Chrome, and Terminal

Safari, Chrome, Terminal, and command-line tools handle proxies differently. Learn how to check macOS network settings, find conflicting browser extensions, and set proxy environment variables.

Check the macOS proxy address and listening port first

First, check whether the request reaches the Clash client, then see which route it takes. The system proxy tells apps that support it to send requests to a local port. Rules determine whether those requests go direct, through a proxy, or get rejected. Enabling the system proxy does not mean every website will use a proxy node.

  1. Confirm which network service is currently connected. On macOS 13 Ventura or later, if you're using Wi-Fi, open System Settings → Network → Wi-Fi → Details for the connected network → Proxies. For a wired connection, go to Network, select the active Ethernet service, then open Details → Proxies. On macOS 12 Monterey, open System Preferences → Network, select the active service, then click Advanced → Proxies.
  2. Check the protocol, address, and port. For configurations using a local HTTP or mixed port, make sure Web Proxy (HTTP) and Secure Web Proxy (HTTPS) point to the address and port the Clash client is actually listening on. For example, if the client shows a mixed port of 7890, both settings can point to 127.0.0.1:7890. A SOCKS-only port cannot be used for HTTP or HTTPS proxy settings.
  3. Check for other proxy settings. Look for Auto Proxy Discovery, Automatic Proxy Configuration, and the proxy bypass list. An automatic proxy configuration script can return different results for different URLs, while the bypass list may send a specific domain direct. On a managed Mac, don't remove a policy yourself; ask your administrator what the current configuration is for.

Then run the following two commands in Terminal. In the second command, 7890 is an example; replace it with the HTTP or mixed port shown in the client.

scutil --proxy
lsof -nP -iTCP:7890 -sTCP:LISTEN

With a manual HTTP proxy, the first command will usually show HTTPEnable : 1, HTTPSEnable : 1, and the corresponding host and port. The second checks the listening process and its bound address. If the settings point to 127.0.0.1:7890 but the client listens on a different port, the browser will try to connect to the wrong one. If you switch from Wi-Fi to a dock's Ethernet connection after closing your MacBook, check the active network service again rather than relying on settings from the previous connection.

Safari not working: use connection logs to tell bypasses from routing rules

Safari usually uses the macOS system proxy. To troubleshoot, open the Clash client's Connections view or available logs, then use Safari to visit an HTTPS page that doesn't require sign-in, such as https://example.com/. Filter by time and hostname, and don't mistake other hosts loaded by the page for the main request.

  • There is a log entry, and the policy shows DIRECT: The request reached the Clash client but went direct according to the rules. Check the matching rule and current policy group; there's no need to keep toggling the system proxy. If direct access is expected for this configuration, it isn't a problem.
  • There is a log entry, but the request failed: Check whether the failure occurred during DNS resolution, the upstream connection, or the handshake. Testing another known-good destination with the same policy group can help distinguish a site-specific issue from an unavailable proxy route.
  • There is no log entry: First make sure the Connections view isn't filtering out the request, then check the system proxy bypass list, automatic proxy configuration, and active network service. Retry in a new browser window. If needed, press ⌘ + Q to quit Safari, then reopen it to rule out stale connections or page cache.

Chrome not working: check extensions, startup flags, and managed policies

If the same destination appears in Safari's connection logs but not Chrome's, start by checking Chrome itself. Chrome uses the macOS system proxy by default, but extensions with proxy permissions, startup flags, and managed policies can change which proxy it actually uses.

  1. Open chrome://extensions/ and temporarily disable extensions that might manage proxy settings, such as proxy switchers or network boosters. Disable one at a time and retry the same URL. Incognito mode isn't a reliable comparison because extensions may be allowed to run there.
  2. Open chrome://version/ and check the Command Line for --proxy-server or --no-proxy-server. If you normally launch Chrome from a script or shortcut, press ⌘ + Q to quit it completely, then reopen it normally from Applications and test again.
  3. Open chrome://policy/ and look for proxy-related policies such as ProxySettings. If a work or school device has relevant policies, note their names and values and ask your administrator to review them. Don't treat managed settings like a regular extension toggle.

If both Chrome and Safari have connection logs but only Chrome reports an error, note the exact error code. ERR_PROXY_CONNECTION_FAILED means you should first check whether the proxy address Chrome is using is reachable. For certificate errors, check the system clock and certificate trust chain. Don't ignore certificate errors to test whether the proxy is working.

Terminal not working: test with curl first, then set export variables

A Terminal window doesn't make every command use the macOS system proxy. First, tell curl to use the local proxy explicitly to rule out differences in tool configuration. These examples assume the Clash client uses 7890 as its local HTTP or mixed port. Both commands use the same destination and allow 15 seconds for the request.

curl -q -vI --max-time 15 --noproxy "" --proxy http://127.0.0.1:7890 https://example.com/
curl -q -vI --max-time 15 --noproxy '*' https://example.com/

Put -q first so curl skips its default configuration file. The first command uses an empty bypass list to force this request through the specified proxy. Look for CONNECT example.com:443 in the output and compare it with the client logs. If it immediately reports that it can't connect to 127.0.0.1, check the listening port first. If the tunnel is established before the error, check TLS or the site's response. The second command tells curl not to use an application-layer proxy; if TUN is enabled, traffic may still be captured by the virtual network interface.

Set proxy variables for the current shell only

export http_proxy='http://127.0.0.1:7890'
export https_proxy='http://127.0.0.1:7890'
export no_proxy='localhost,127.0.0.1,::1'
curl -q -vI --max-time 15 https://example.com/

The http:// in https_proxy specifies the protocol used to connect from Terminal to the local proxy; it doesn't describe the destination website's protocol. For an HTTPS site, curl can send a CONNECT request through an HTTP proxy, then establish TLS with the destination through the tunnel. These examples use lowercase variables. In particular, don't set only HTTP_PROXY: curl does not read that uppercase variable for HTTP requests.

These variables affect only the current shell and programs launched from it afterward that support them. If an explicitly proxied request works but one without the flags doesn't, first check that you exported the variables in the same Terminal window. Then check for existing NO_PROXY or ALL_PROXY variables, or settings specific to the tool. A successful curl request doesn't mean Git's SSH connection will use the same proxy. For repository URLs starting with git@ or ssh://, check the SSH configuration separately.

When you're done testing, run unset http_proxy https_proxy no_proxy to remove these settings; restore the previous values if your test overwrote them. Verify the setup before adding it to a shell startup file. Otherwise, new Terminal windows may keep sending requests to a closed port after you quit the Clash client.

When to use TUN mode

If Safari and Chrome work as expected and only a particular command-line tool fails, use that tool's proxy settings if available; there's no need to enable TUN first. Consider TUN only if the target app neither uses the system proxy nor offers a suitable in-app proxy option, and the client supports capturing this type of traffic through TUN.

TUN captures traffic through a virtual network interface and routing, but is still affected by route scope, exclusions, and outbound rules. Change one thing at a time: keep the same test URL and note the original system proxy and Terminal variable settings. Then enable TUN as described by the client and check whether the same request appears in the connection logs. If enabling TUN disrupts access to your company's intranet, local network, or VPN, turn TUN off to restore the previous setup, then check for routing conflicts instead of switching the outbound mode to Global.

Use these three signals to quickly pinpoint the issue: if the request never reaches the local port, check system or app settings; if it reaches the port but goes DIRECT, check the matching rules; if a proxy route is selected but the connection fails, check that route and the logs. Keep the URL and port the same for every test so you can tell which change made a difference.

Download Clash