macOS proxy settings for rotating proxies

You can configure rotating proxies on macOS through the System Settings GUI, the `networksetup` command line tool, or within individual applications. Connect to the gateway at gw.rotatingproxy.cc on port 7070 for HTTP/HTTPS and port 7071 for SOCKS5.

Key points
  • Set proxy for all traffic in System Settings > Network > Details > Proxies.
  • Use networksetup command line to configure specific network services.
  • Pass geo-targeting and session options in the proxy username.
  • Test your exit IP with curl through the proxy.

macOS proxy settings overview

macOS provides several layers for proxy configuration, from system-wide settings that affect all applications to per-application configurations. The system-wide macOS proxy settings are managed per network service (like Wi-Fi or Ethernet) and can be set graphically or via the Terminal. For tasks like web scraping or price monitoring, you might prefer to configure proxies only within your scraping tool, such as Python requests or Playwright, to avoid affecting other internet traffic on your Mac.

System Settings GUI (Ventura and later)

Open System Settings, go to Network, and select your active network service (e.g., Wi-Fi). Click the "Details" button next to the service name. In the sidebar that appears, select "Proxies". You will see checkboxes for various proxy protocols. To use RotatingProxy's HTTP/HTTPS gateway, check "Web Proxy (HTTP)" and "Secure Web Proxy (HTTPS)". Enter gw.rotatingproxy.cc as the server and 7070 as the port for both. Check the box for "Proxy server requires password" and enter your proxy username and password. The username must include any targeting options, for example USERNAME_net.res_cc.us_st.ca_city.san-francisco. This method sets a system-wide proxy, which will be used by many, but not all, applications.

networksetup command line for automation

The networksetup command allows you to configure macOS proxy settings from scripts or the Terminal, which is ideal for automation. Start by listing your network services using networksetup -listallnetworkservices. Identify the service you want to configure, such as "Wi-Fi" or "Ethernet". To enable the HTTP proxy for that service, use:

networksetup -setwebproxy "Wi-Fi" gw.rotatingproxy.cc 7070
networksetup -setwebproxystate "Wi-Fi" on
networksetup -setsecurewebproxy "Wi-Fi" gw.rotatingproxy.cc 7070
networksetup -setsecurewebproxystate "Wi-Fi" on

To set the proxy username and password (which includes your options):

networksetup -setwebproxyauthentication "Wi-Fi" on USERNAME_net.mob_cc.de PASSWORD
networksetup -setsecurewebproxyauthentication "Wi-Fi" on USERNAME_net.mob_cc.de PASSWORD

For SOCKS5 on port 7071, use:

networksetup -setsocksfirewallproxy "Wi-Fi" gw.rotatingproxy.cc 7071
networksetup -setsocksfirewallproxystate "Wi-Fi" on

Note that the SOCKS5 configuration via networksetup does not have a built-in command for username/password authentication. For SOCKS5 with auth, you must configure it within your application, as explained in the curl proxy guide. To turn all proxies off for a service, use networksetup -setwebproxystate "Wi-Fi" off and the corresponding commands for secure web and SOCKS.

Application-specific proxy configuration

Many tools used for data collection allow you to set a proxy independently of the system macOS proxy settings. This is often the preferred method because it isolates proxy traffic to that specific task. For example, in Python, you can configure the requests library to use our gateway. The following code uses the HTTP proxy port 7070 with a residential proxy targeting France and a sticky session.

import requests

proxies = {
    'http': 'http://USERNAME_net.res_cc.fr_sid.abc123_ttl.30:PASSWORD@gw.rotatingproxy.cc:7070',
    'https': 'http://USERNAME_net.res_cc.fr_sid.abc123_ttl.30:PASSWORD@gw.rotatingproxy.cc:7070'
}

response = requests.get('https://api.ipify.org', proxies=proxies)
print(response.text)

For headless browsers, Playwright and Selenium have their own proxy arguments. This approach gives you fine-grained control, essential for rank tracking across different locations or market research.

Setting up SOCKS5 proxy on macOS

Our SOCKS5 gateway runs on port 7071. While the system SOCKS proxy in Network settings can be configured, it does not support username/password authentication at the system level. Therefore, to use SOCKS5, you must configure it within your application. For instance, with curl, you can use the --socks5-hostname flag with the username and password embedded in the host string.

curl --socks5-hostname USERNAME_net.dc_cc.us:PASSWORD@gw.rotatingproxy.cc:7071 https://ipinfo.io/json

In Python, the requests library does not natively support authenticated SOCKS5. You would need to use a SOCKS-supporting library like httpx or aiohttp with an additional socks connector. Check the current docs for httpx proxy and aiohttp proxy for the exact syntax, as library details may change.

Passing location and session in the username

All targeting and session control is done through the proxy username. The basic format is your proxy user login, an underscore, then options joined with underscores. The network is set with net.res (residential), net.mob (mobile), net.dc (datacenter), or net.isp (ISP). The default is net.res. For country targeting, use cc.us (lowercase ISO code). For US states, add st.ca (only works with cc.us). For cities, use city.chicago (city tokens are lowercase with hyphens for spaces). To maintain a sticky IP for a session, include sid.abc123 (6-16 alphanumeric chars) and optionally ttl.30 (session lifetime in minutes, 1-120, default 10). An example username for a mobile proxy in Berlin with a 20-minute session is USERNAME_net.mob_cc.de_city.berlin_sid.a7k2m9_ttl.20. You can use our proxy URL builder to generate these strings.

Verifying your proxy connection and exit IP

After configuring your macOS proxy settings, verify that traffic is routing correctly and that you're getting an IP from your target location. A simple test with curl using the HTTP proxy port:

curl -x http://USERNAME_net.res_cc.jp:PASSWORD@gw.rotatingproxy.cc:7070 https://api.ipify.org

This should return an IP address. For more details like location, use:

curl -x http://USERNAME_net.res_cc.jp:PASSWORD@gw.rotatingproxy.cc:7070 https://ipinfo.io/json

The response should show a country (and possibly city) matching your cc. and city. targets. If you are using a session ID, run the same command twice; the IP should remain the same within the TTL window. For a deeper understanding of IP assignment, read our guide on how IP rotation works.

Fixing common proxy errors on macOS

Error 407 (Proxy Authentication Required): This means your username or password is incorrect or malformed. Double-check that the entire username string (with options) and password are correct. Ensure there are no typos and that underscores are used correctly. See proxy error 407 for more details.

Timeouts or slow connections: Timeouts can occur if the target server is slow or if your connection to our gateway is unstable. First, test your direct internet connection. Then, try a different target location or network; for example, switch from residential to datacenter or ISP proxies for lower latency. Increase your application's timeout settings. Our guide on proxy timeouts has further troubleshooting steps.

TLS/SSL errors: When using the HTTP proxy port (7070) for HTTPS traffic, your client should use the HTTP CONNECT method. Most modern libraries (curl, requests, etc.) handle this automatically. If you see TLS handshake failures, ensure you are not accidentally trying to send HTTPS traffic to the SOCKS5 port or vice versa. Verify your application's proxy configuration supports HTTPS tunneling.

Tips for running at scale on macOS

When performing large-scale data collection, such as for ecommerce intelligence or financial data collection, consider these points. First, avoid system-wide proxy settings; configure proxies per application to avoid interfering with other software. Second, manage concurrency wisely; your account allows up to 1,000 concurrent connections, but your Mac's network stack and the target sites' limits are more practical constraints. Implement rate limiting and retry strategies in your code. Third, use sticky sessions (sid) when you need to maintain login state or a consistent IP for a sequence of requests, but use rotating sessions (no sid) when you need a fresh IP for each task to avoid detection. Fourth, monitor your traffic usage and balance to avoid unexpected stoppages. Finally, for heavy workloads, consider running your scraper in a cloud environment rather than locally on your Mac, but the proxy setup principles remain the same.

Using proxies with browser automation tools

Browser automation tools like Playwright and Puppeteer are common for localization testing and app testing. These tools have built-in proxy support. For Playwright in Python, you launch a browser context with proxy settings:

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.launch(proxy={
        "server": "http://gw.rotatingproxy.cc:7070",
        "username": "USERNAME_net.isp_cc.gb",
        "password": "PASSWORD"
    })
    context = browser.new_context()
    page = context.new_page()
    page.goto("http://whatismyipaddress.com")
    browser.close()

For Puppeteer in Node.js, refer to the Puppeteer proxy guide. Always ensure you are using the correct network type for your use case; mobile proxies (net.mob) are often effective for TikTok or Instagram data collection.

Switching between proxy configurations quickly

If you need to frequently change between different proxy targets (e.g., testing prices on Walmart from different states), creating shell scripts or aliases using the networksetup commands is efficient. You can write a script that takes a country code or network type as an argument and runs the appropriate networksetup -setwebproxy and authentication commands. Alternatively, maintain different proxy user logins in your application's configuration file or environment variables, and switch between them programmatically. This flexibility is key for travel fare aggregation across origins.

Questions

Can I set a different proxy for Wi-Fi and Ethernet on my Mac?

Yes, macOS proxy settings are configured per network service. You can have different proxy settings for your Wi-Fi and Ethernet connections using either the System Settings GUI or different `networksetup` commands targeting each service name.

Why is my curl command failing with "Proxy authentication required" when the password is correct?

This often happens if the username string contains special characters that need to be URL-encoded. Try using the `-U` flag to pass the username and password separately: `curl -x http://gw.rotatingproxy.cc:7070 -U "USERNAME_net.res_cc.us:PASSWORD" https://api.ipify.org`. Also, verify you are using the correct proxy user login from your dashboard.

Does setting the proxy in macOS System Settings affect the Terminal and command line tools?

It affects many command-line tools that respect the system proxy environment variables (like `curl` and `wget`), but not all. Tools like `networksetup` itself do not use the proxy. You can also override system settings by explicitly providing proxy arguments to the command, which is the more reliable method for scripting.

How do I use a SOCKS5 proxy with authentication in a Python script on macOS?

The standard `requests` library does not support SOCKS5 with auth. You need to use `httpx` or `requests` with a SOCKS adapter. For `httpx`, install `httpx-socks` and use an async or sync transport. Check the current httpx proxy documentation for the exact code, as the implementation can change between versions.

My application is ignoring the macOS system proxy settings. What should I do?

Some applications, especially those built with low-level networking libraries, do not honor system proxy settings. In this case, you must configure the proxy within the application's own settings or via its API. Refer to the application's documentation or look for our specific integration guide, such as Docker proxy settings or Git proxy settings.

Can I target a specific city in Canada with residential proxies?

Yes, if the city is listed in our available locations. You would use a username like `USERNAME_net.res_cc.ca_city.toronto`. Check the city targeting list in your dashboard or the locations page to see if your desired city is supported. If not, you can still target the country (`cc.ca`), and you will get an IP from within that country.

Start with one top-up, use any network

Create an account in a minute, add $40 or more, and the same balance pays for residential, mobile, datacenter and ISP traffic.