πŸŽ‰ Premium Proxies Β· 3-Day Free TrialClaim Now β†’
Guides

Datacenter Proxy on Mac: Fast macOS Setup Guide

Set up a datacenter proxy on Mac in minutes. Step-by-step macOS System Settings and networksetup CLI guide, plus per-app config, testing, and error fixes.

S SparkProxy 18 14 min read
Share
Datacenter Proxy on Mac: Fast macOS Setup Guide

Configuring a datacenter proxy on Mac is straightforward in concept, but has one quirk that trips up most users: macOS applies proxy settings per network service, not system-wide. Set it on Wi-Fi and then switch to Ethernet or a USB adapter, and your proxy disappears. This guide covers every method to configure proxy Mac settings correctly: System Settings (GUI), the networksetup command-line tool, environment variables, and per-app configuration for Python, curl, and git.

What Is a Datacenter Proxy on Mac?

A datacenter proxy routes your outbound traffic through a server in a commercial data center, giving you a fixed commercial IP address. On Mac, setting up a datacenter proxy Mac configuration means telling macOS, and the apps running on it, where to send HTTP and HTTPS traffic.

Unlike Windows, macOS does not split proxy stores between user apps and system services. All macOS apps that respect the system proxy (browsers, most native apps, URLSession-based tools) read from the same proxy settings in System Settings. The challenge is that those settings are per network interface, not global.

Common Mac datacenter proxy use cases:

Use CaseToolBest Config Method
Web scrapingPython requests, httpxEnvironment variables or proxies dict
Browser automationPlaywright, SeleniumSystem Settings or launch args
Ad verificationSafari, Chrome, FirefoxSystem Settings (per network service)
API testingcurl, Postman`-x` flag or `HTTPS_PROXY` env var
Git / npm / pipgit, npm, pipPer-tool config or env vars
Server-side scriptsBash, Python`HTTP_PROXY` / `HTTPS_PROXY` env vars

Running data collection at scale? Using datacenter proxies for web scraping walks through rotation, rate limits, and retry logic.


Mac Proxy Setup via System Settings

System Settings is the easiest way to set up a Mac proxy for browser-based and GUI app traffic. These steps apply to macOS Ventura (13) and later.

Step 1: Identify Your Active Network Service

Open System Settings β†’ Network in the sidebar.

You will see a list of network services, for example:

  • Wi-Fi
  • Ethernet
  • Thunderbolt Bridge
  • USB 10/100/1000 LAN

Find the service currently marked as Connected. You must configure the proxy on this specific service. If you use multiple interfaces (e.g., Wi-Fi at home and Ethernet in the office), configure each one.

Step 2: Open the Proxies Panel

  1. Click your connected network service (e.g., Wi-Fi)
  2. Click Details…
  3. Click the Proxies tab

Step 3: Disable Auto Proxy Discovery

Turn off Auto proxy discovery unless your network administrator has set up WPAD/DHCP-based proxy discovery. Leaving it on can override your manual settings on networks that broadcast a WPAD record.

Step 4: Enable Web Proxy (HTTP)

Turn on Web proxy (HTTP). Enter:

  • Server: your-proxy.sparkproxy.io
  • Port: 10000

Not sure which port to use? Proxy ports explained breaks down 80, 443, 8080, and custom ports like 10000.

If your proxy requires credentials, turn on Proxy server requires password and enter your username and password.

Step 5: Enable Secure Web Proxy (HTTPS)

Turn on Secure web proxy (HTTPS). Enter the same server and port. Most datacenter proxies use the same endpoint for both HTTP and HTTPS traffic.

Note: HTTP and HTTPS proxy fields are separate on Mac. A common mistake is filling in only the HTTP field and finding that HTTPS requests (most modern web traffic) still go direct.

Step 6: Configure the Bypass List

In the Bypass proxy settings for these Hosts & Domains field, enter:

localhost, 127.0.0.1, *.local

Use commas to separate entries. The *.local entry prevents mDNS-based local hostname lookups from going through the proxy.

Step 7: Click OK and Apply

Click OK, then Apply (if prompted). Changes take effect for new connections immediately.


Free trial

Scraping at scale? Skip the blocks.

Fast, unblockable datacentre proxies with unlimited bandwidth.

Configure a Proxy on Mac via networksetup (Terminal)

The networksetup command is the Terminal equivalent of System Settings' Proxies panel. It is scriptable, idempotent, and essential for automation. All networksetup proxy commands require sudo (or admin credentials).

List All Network Services

Before setting a proxy, identify the exact service name:

networksetup -listallnetworkservices

Example output:

An asterisk (*) denotes that a network service is disabled.
Wi-Fi
Ethernet
Thunderbolt Bridge
USB 10/100/1000 LAN

Use the exact name (case-sensitive, spaces included) in all subsequent commands.

Get Current Proxy Settings

# Check HTTP proxy
networksetup -getwebproxy "Wi-Fi"

# Check HTTPS proxy
networksetup -getsecurewebproxy "Wi-Fi"

# Check SOCKS proxy
networksetup -getsocksfirewallproxy "Wi-Fi"

# Check bypass domains
networksetup -getproxybypassdomains "Wi-Fi"

Sample output when no proxy is set:

Enabled: No
Server:
Port: 0
Authenticated Proxy Enabled: 0

Set HTTP and HTTPS Proxy (IP Whitelist, No Credentials)

If you use IP whitelisting (your machine's IP is added to the provider whitelist), omit the on username password parameters:

Not sure which authentication method to pick? How proxy authentication works compares IP whitelisting and username-password credentials in detail.

# HTTP proxy
sudo networksetup -setwebproxy "Wi-Fi" your-proxy.sparkproxy.io 10000

# HTTPS proxy
sudo networksetup -setsecurewebproxy "Wi-Fi" your-proxy.sparkproxy.io 10000

Set HTTP and HTTPS Proxy with Username-Password Authentication

# HTTP proxy with credentials
sudo networksetup -setwebproxy "Wi-Fi" your-proxy.sparkproxy.io 10000 on YOUR_USER YOUR_PASS

# HTTPS proxy with credentials
sudo networksetup -setsecurewebproxy "Wi-Fi" your-proxy.sparkproxy.io 10000 on YOUR_USER YOUR_PASS

The on argument enables authenticated proxy support. Credentials are stored in the macOS System Keychain.

Enable / Disable the Proxy Without Changing Settings

# Enable
sudo networksetup -setwebproxystate "Wi-Fi" on
sudo networksetup -setsecurewebproxystate "Wi-Fi" on

# Disable (keep settings, just turn off)
sudo networksetup -setwebproxystate "Wi-Fi" off
sudo networksetup -setsecurewebproxystate "Wi-Fi" off

Set Proxy Bypass Domains

sudo networksetup -setproxybypassdomains "Wi-Fi" localhost 127.0.0.1 "*.local"

Pass each domain as a separate argument. Use "Empty" to clear all bypass entries:

sudo networksetup -setproxybypassdomains "Wi-Fi" "Empty"

Verify Settings

networksetup -getwebproxy "Wi-Fi"

Expected output after configuration:

Enabled: Yes
Server: your-proxy.sparkproxy.io
Port: 10000
Authenticated Proxy Enabled: 0

Per-Service Proxy: Why Mac Is Different from Windows

This is the most important architectural difference between macOS and Windows proxy configuration:

macOS Proxy Architecture
─────────────────────────────────────────────────────────
  Wi-Fi         β†’ Proxy: your-proxy.sparkproxy.io:10000 βœ“
  Ethernet      β†’ Proxy: (none, inherits nothing)       βœ—
  USB LAN       β†’ Proxy: (none, inherits nothing)       βœ—
  Thunderbolt   β†’ Proxy: (none, inherits nothing)       βœ—
─────────────────────────────────────────────────────────
  Each service has its own independent proxy config.
  Changing one does NOT affect the others.

Real-world scenario: You configure a datacenter proxy on your Wi-Fi at your desk. Later, you plug in a USB Ethernet adapter for a faster connection. Your traffic now bypasses the proxy entirely, because Ethernet has no proxy configured. Your scripts appear to work, but the exit IP is your real IP.

On Windows, configuring the proxy in Windows Settings (WinINet) applies across all network interfaces (see how to set up a datacenter proxy on Windows). macOS does not work this way.

Fix: Configure the proxy on every network service you use, or use the shell script in the next section to configure all services at once.


Configure All Network Services at Once (Shell Script)

This script reads all active network services and applies the proxy to each one, solving the per-service problem:

#!/bin/bash
# configure-mac-proxy.sh
# Sets datacenter proxy on all network services at once.
# Usage: sudo bash configure-mac-proxy.sh

PROXY_HOST="your-proxy.sparkproxy.io"
PROXY_PORT="10000"
BYPASS_DOMAINS="localhost 127.0.0.1 *.local"

# Get all services, skip the header line
services=$(networksetup -listallnetworkservices | tail -n +2)

while IFS= read -r service; do
    # Skip disabled services (prefixed with *)
    if [[ "$service" == \** ]]; then
        echo "Skipping disabled service: $service"
        continue
    fi

    echo "Configuring proxy for: $service"
    networksetup -setwebproxy "$service" "$PROXY_HOST" "$PROXY_PORT"
    networksetup -setsecurewebproxy "$service" "$PROXY_HOST" "$PROXY_PORT"
    networksetup -setproxybypassdomains "$service" $BYPASS_DOMAINS
    echo "  Done: $service"
done <<< "$services"

echo ""
echo "Proxy configured on all active network services."
echo "Run 'networksetup -getwebproxy \"Wi-Fi\"' to verify."

Run with:

sudo bash configure-mac-proxy.sh

To remove the proxy from all services, replace the setwebproxy calls with setwebproxystate "$service" off.


Per-App Proxy Configuration on Mac

For scripting and automation, set the proxy at the application level to keep configurations portable and explicit.

curl

# With credentials
curl --proxy http://user:pass@your-proxy.sparkproxy.io:10000 https://httpbin.org/ip

# With IP whitelisting (no credentials)
curl --proxy your-proxy.sparkproxy.io:10000 https://httpbin.org/ip

# Permanent config in ~/.curlrc
echo 'proxy = "your-proxy.sparkproxy.io:10000"' >> ~/.curlrc

Python requests

For scraping and automation workloads, using datacenter proxies with Python covers sessions, retries, and rotation in more depth.

import requests

# With credentials
proxies = {
    "http":  "http://user:pass@your-proxy.sparkproxy.io:10000",
    "https": "http://user:pass@your-proxy.sparkproxy.io:10000",
}

# With IP whitelisting
proxies = {
    "http":  "http://your-proxy.sparkproxy.io:10000",
    "https": "http://your-proxy.sparkproxy.io:10000",
}

response = requests.get("https://httpbin.org/ip", proxies=proxies)
print(response.json())  # {"origin": "<proxy exit IP>"}

httpx (async Python)

import httpx

proxies = {"https://": "http://user:pass@your-proxy.sparkproxy.io:10000"}

with httpx.Client(proxies=proxies) as client:
    r = client.get("https://httpbin.org/ip")
    print(r.json())

git

git config --global http.proxy http://user:pass@your-proxy.sparkproxy.io:10000
git config --global https.proxy http://user:pass@your-proxy.sparkproxy.io:10000

# Remove
git config --global --unset http.proxy
git config --global --unset https.proxy

pip / Homebrew

# pip
pip install some-package --proxy http://user:pass@your-proxy.sparkproxy.io:10000

# Homebrew reads HTTPS_PROXY environment variable automatically
export HTTPS_PROXY=http://user:pass@your-proxy.sparkproxy.io:10000
brew update

Set Environment Variables for Proxy on Mac

Environment variables are the universal proxy mechanism for Terminal tools on macOS. Most CLI tools (curl, wget, git, npm, pip, Python urllib) read these automatically.

Set for Current Terminal Session

export HTTP_PROXY="http://user:pass@your-proxy.sparkproxy.io:10000"
export HTTPS_PROXY="http://user:pass@your-proxy.sparkproxy.io:10000"
export NO_PROXY="localhost,127.0.0.1,*.local"

With IP whitelisting (no credentials in URL):

export HTTP_PROXY="http://your-proxy.sparkproxy.io:10000"
export HTTPS_PROXY="http://your-proxy.sparkproxy.io:10000"

Make Persistent Across Sessions

Add to ~/.zshrc (Zsh, default on macOS Catalina and later) or ~/.bash_profile (Bash):

echo 'export HTTP_PROXY="http://user:pass@your-proxy.sparkproxy.io:10000"' >> ~/.zshrc
echo 'export HTTPS_PROXY="http://user:pass@your-proxy.sparkproxy.io:10000"' >> ~/.zshrc
echo 'export NO_PROXY="localhost,127.0.0.1,*.local"' >> ~/.zshrc
source ~/.zshrc

Unset for Current Session

unset HTTP_PROXY
unset HTTPS_PROXY
unset NO_PROXY

Security note: Credentials embedded in environment variables are visible to other processes running as the same user via ps, env, or /proc. For production use, prefer IP whitelisting or pass credentials directly to each tool via its native config file.


Test Your Datacenter Proxy on Mac

After configuring your proxy, verify the exit IP before running your actual workload. For a deeper checklist, see how to test if your proxy is working.

Test 1: Check Exit IP (curl)

curl https://httpbin.org/ip

The origin field should show your proxy's datacenter IP, not your local IP.

Test 2: Check System Proxy Is Active (curl reading System Settings)

By default on macOS, curl does not automatically read System Settings proxy. Pass -x explicitly or use --proxy-use-network on recent versions. To force curl to use the system proxy:

# Use system proxy via environment variable (set from System Settings)
export HTTPS_PROXY="http://your-proxy.sparkproxy.io:10000"
curl https://httpbin.org/ip

Or test directly:

curl -x your-proxy.sparkproxy.io:10000 https://httpbin.org/ip

Test 3: Verify networksetup Settings Applied

networksetup -getwebproxy "Wi-Fi"
networksetup -getsecurewebproxy "Wi-Fi"

Both should show Enabled: Yes with your proxy host and port.

Test 4: Browser Test (Safari / Chrome)

Open Safari or Chrome and visit https://httpbin.org/ip. Because these browsers respect System Settings proxy on macOS, the IP returned should be your datacenter proxy's exit IP, not your ISP-assigned IP.


Disable or Remove a Proxy on Mac

Disable via System Settings

  1. System Settings β†’ Network β†’ [service] β†’ Details β†’ Proxies
  2. Turn off Web proxy (HTTP) and Secure web proxy (HTTPS)
  3. Click OK β†’ Apply

Disable via Terminal (Keep Settings, Just Turn Off)

sudo networksetup -setwebproxystate "Wi-Fi" off
sudo networksetup -setsecurewebproxystate "Wi-Fi" off

Remove Settings Completely via Terminal

# Clear HTTP proxy
sudo networksetup -setwebproxy "Wi-Fi" "" 0
sudo networksetup -setwebproxystate "Wi-Fi" off

# Clear HTTPS proxy
sudo networksetup -setsecurewebproxy "Wi-Fi" "" 0
sudo networksetup -setsecurewebproxystate "Wi-Fi" off

# Clear bypass domains
sudo networksetup -setproxybypassdomains "Wi-Fi" "Empty"

Remove Environment Variables

unset HTTP_PROXY HTTPS_PROXY NO_PROXY

# If added to ~/.zshrc, remove the export lines:
nano ~/.zshrc
# Delete the proxy export lines, then:
source ~/.zshrc

Common Proxy Errors on Mac and Fixes

ErrorCauseFix
`curl: (56) Proxy CONNECT aborted`Proxy host unreachable or port blockedTest `nc -zv your-proxy.sparkproxy.io 10000`; check firewall
`407 Proxy Authentication Required`Credentials wrong or IP not whitelistedVerify user/pass or add machine IP to whitelist in dashboard
Proxy set in System Settings, browser still directSet on wrong network service (e.g., Ethernet instead of Wi-Fi)Check which service shows **Connected** and configure that one
Proxy works in Safari, fails in Python script`requests` doesn't read System Settings by defaultPass `proxies=` dict or set `HTTPS_PROXY` env var
`SSLError: CERTIFICATE_VERIFY_FAILED` in PythonProxy doing TLS interception; cert not trusted by PythonSet `verify=False` for testing only; for production install proxy CA cert
Proxy stops after sleep/wakeDHCP renewed IP; IP whitelist entry expiredUse username-password auth or assign a static IP; re-add IP to whitelist
`networksetup: You need administrator access`Not running with `sudo`Prefix command with `sudo`
Service name not foundCase-sensitive or wrong service nameRun `networksetup -listallnetworkservices` to get exact names
curl ignores System Settings proxymacOS curl does not auto-read System SettingsSet `HTTPS_PROXY` env var or use `-x` flag explicitly

Frequently asked questions

Apps that use Apple's URLSession or CFNetwork frameworks (Safari, most native apps) automatically read the proxy from System Settings for the active network service. Terminal tools like curl and wget do not read System Settings proxy by default on macOS. They look at HTTP_PROXY and HTTPS_PROXY environment variables instead. Python requests also reads environment variables, not System Settings, unless you use trust_env=True explicitly.

Safari uses URLSession, which respects System Settings proxy. Python requests uses urllib3 and reads HTTP_PROXY / HTTPS_PROXY environment variables by default. Set those variables or pass a proxies dict directly to requests.get().

macOS proxy configuration is already per-network-service. Open System Settings β†’ Network, select your target network service (e.g., Wi-Fi but not Ethernet), and configure the proxy only on that service. Other services continue with direct connections.

sudo networksetup -setwebproxy "Wi-Fi" proxy-host port sets the HTTP proxy, and sudo networksetup -setsecurewebproxy "Wi-Fi" proxy-host port sets the HTTPS proxy. These are the exact Terminal equivalents of filling in the Web proxy and Secure web proxy fields in System Settings β†’ Network β†’ Details β†’ Proxies.

Yes. Use sudo networksetup -setsocksfirewallproxy "Wi-Fi" proxy-host port for SOCKS proxies via System Settings, or set ALL_PROXY=socks5://user:pass@proxy-host:port for Terminal tools.

Run curl https://httpbin.org/ip with the proxy active. The returned IP should match your proxy provider's datacenter IP. Compare against curl --noproxy '*' https://httpbin.org/ip (bypasses proxy). The two results should be different. If they match, the proxy is not being used.


Limited-time Β· 50% off

Get 50% off your first purchase

Premium datacentre proxies with unlimited bandwidth. Use the code at checkout.

Offer ends soon β€” claim it before it's gone

Claim Discount

About the Author

SparkProxy Technical Team. The SparkProxy engineering team builds and maintains global datacenter and residential proxy infrastructure. This guide reflects configuration patterns tested across macOS Ventura, Sonoma, and Sequoia.

Citations: Change proxy settings on Mac (Apple Support) Β· Enter proxy server settings on Mac (Apple Support)

Keep reading

Related articles