How to Configure MacOS Proxy Settings Correctly
A proxy server in macOS can enhance connection security, restrict traffic for specific applications, or enable access to websites that are blocked in a particular region. This guide explains how to finetune macOS proxy settings, verify that the configuration is correct, and resolve potential issues that may occur during the process.
How to Configure Proxy on macOS
System-level setup takes only a few minutes and does not require additional software.
-
Open the System Preferences menu from the bottom panel and navigate to the Network tab.
-
Select the active internet connection, click the Advanced button located in the lower right corner.
-
Go to the Proxies tab and select the required protocol type (in this example, HTTPS is selected).
-
Enter the new IP address and port. If authentication is required, enable it by checking the “Proxy server requires password” option and entering the credentials provided by your service provider.
-
In the Bypass proxy settings for these “Hosts & Domains” box, specify the addresses of websites that should be accessed without using the configured new IP, then click OK.
-
Click Apply in the main window to save the changes.
-
After closing the network settings, a confirmation window will appear for the new configuration. Click Apply to finalize the changes.
How to Check Proxy Settings on macOS
After saving the parameters, it is advisable to confirm that the system is actually applying the new intermediary server. This can be done both through the interface and via the Terminal.
The first option involves following the same path described earlier to the Proxies tab. Here, the configured protocol, address, port, and authentication status will be displayed.
If the parameters need to be checked via Terminal, launch it and use the following commands:
For macOS HTTP proxy:
networksetup -getwebproxy Wi-Fi
networksetup -getsecurewebproxy Wi-Fi
For macOS socks5 proxy:
networksetup -getsocksfirewallproxy Wi-Fi
The output will display the IP and port in use, as well as whether authentication is required. This makes it easy to confirm that the macOS proxy settings are correct and that the specified host is indeed active, without the need to open the interface.
How to Configure macOS Bypass Proxy Settings
In some cases, certain websites or software must operate without routing traffic through the intermediary server – for example, internal corporate services or local domains. macOS provides a dedicated exclusion mechanism, mentioned earlier during the setup stage.
In the Proxies tab, at the bottom of the window, use the Bypass proxy settings for these Hosts & Domains field to enter a list of addresses that should bypass the configured connection, for example:
localhost, 127.0.0.1, *.example.com
Each element is separated by a comma. Wildcards (*), IP addresses, and domain names are supported.
This method allows excluding specific websites and entire subnets from being routed through the intermediary. It is especially useful in hybrid networks (where both local and external internet resources are used). Exclusions are also added when working with local tools such as internal corporate services, CRM systems, network printers, or database management systems accessible only within a specific network.
How to Set a Proxy for Individual Applications in macOS
Sometimes macOS proxy settings at system level are not sufficient, as some applications do not use the operating system’s global proxy configuration. In such cases, the parameters must be specified manually — either within the application itself or via environment variables in Terminal.
Safari does not require a separate configuration — it uses the system settings by default.
In Google Chrome, the browser can be launched with a proxy server flag, for example:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --proxy-server="socks5://127.0.0.1:1080"
Chrome does not support passing a username and password directly in the flag. When a site is opened, the browser will display an authentication prompt (as with a regular HTTP), where the credentials must be entered manually. This also applies after a system restart or if, for any reason, the previously entered credentials were not saved (for example, due to a restart or incorrect username/password).
To resolve this, simply enter the authentication credentials in the prompt and click OK.
In Terminal, an intermediary server can be specified for all CLI tools using environment variables:
export http_proxy="http://user:[email protected]:8080"
export https_proxy="http://user:[email protected]:8080"
export ALL_PROXY="socks5://127.0.0.1:1080"
To ensure these variables are applied at every launch, add them to .zshrc or .bash_profile.
Utilities such as curl, wget, npm, git, and similar tools also use these variables, although some have their own configuration files that may take priority.
The table below shows such tools and the methods for specifying a proxy server directly.
Utility |
Command or Configuration File |
Example Configuration |
npm |
npm config set proxy и https-proxy |
npm config set proxy http://user:[email protected]:8080 |
git |
git config --global http.proxy |
git config --global http.proxy http://user:[email protected]:8080 |
wget |
~/.wgetrc |
http_proxy = http://user:[email protected]:8080 |
yarn |
yarn config set proxy и https-proxy |
yarn config set proxy http://user:[email protected]:8080 |
pip |
~/.pip/pip.conf |
[global] proxy = http://user:[email protected]:8080 |
apt |
/etc/apt/apt.conf or files in /etc/apt/apt.conf.d/ |
Acquire::http::Proxy "http://user:[email protected]:8080"; |
brew |
HOMEBREW_GIT_CONFIG variable |
export HOMEBREW_GIT_CONFIG="http.proxy=http://... https.proxy=http://..." |
Some graphical applications (GUI-based software) do not use the system’s proxy settings. As a result, even if an intermediary server is configured at the network level, these programs may ignore it and require manual configuration. For example, in email clients, FTP managers, or code editors (VS Code, IntelliJ IDEA, etc.), such parameters are usually set in the “Proxy” section, where the IP, port, username, and password can be specified.
If an application does not support proxy configuration at all, special utilities such as Proxifier can be used. They intercept the network traffic of specific programs and route it through the configured proxy server, even if the application itself lacks such functionality.
Conclusion
Intermediary servers in macOS can be configured flexibly for specific tasks — such as traffic control or access to required resources. The effectiveness of these settings depends not only on the correct parameters but also on an understanding of how different types of applications and tools in the system behave. It is important to note that not all programs use system parameters, so being prepared for separate configurations for CLI tools and network exclusions is essential. This approach ensures stable and predictable connection behavior in any conditions.
FAQ
Can different proxies be set for Wi-Fi and Ethernet in macOS?
Yes. Settings are configured separately for each network interface. You can specify one IP for Wi-Fi and another for Ethernet.
Does macOS support automatic switching of proxy servers across networks?
Partially. When switching between networks (for example, home and work Wi-Fi), the operating system automatically applies the saved settings for each connection. If a change within the same network is required, a PAC script can be used – a special file that determines which proxy server to apply depending on the specified conditions (such as the destination address).
How to remove a proxy server from the operating system?
In the Proxies section, clear all checkboxes, then click OK and Apply.