Skip to main content
Version: 2.16.0

Configure proxy and exclusions on MacOS

This guide explains how to configure proxy settings and exclusions on macOS when using an ip-based proxy, including an exclusion list for applications that rely on websockets, such as:

  • Slack
  • Lucidchart
  • Figma

These apps often fail behind proxies like squid, which don’t support websockets by default.

Manual method (system settings)

  1. Navigate to system settingsnetwork.
  2. Select your active interface (e.g., wi-fi).
  3. Click detailsproxies.
  4. Under web proxy (http) and secure web proxy (https):
    • Replaceproxy.company.comWith your proxy ip (e.g.,192.168.1.10)
    • Set port (commonly8080)
  5. In bypass domains, add the required domains (see below).
  6. Click ok, then apply.

What this script does

  • Applies proxy settings to all network interfaces
  • Sets http and https proxy
  • Configures a list of bypass domains that will not use the proxy
  • Ideal for use withnetworksetupAnd mdm-managed devices

Scripted method (bash)

#!/bin/bash

# Define proxy server and port
PROXY="192.168.1.10"
PORT="8080"

# Domains to exclude from proxy — especially for WebSocket-based apps
EXCLUSIONS="localhost,127.0.0.1,*.microsoftonline.com,*.core.windows.net,*.slack.com,*.figma.com,*.lucidchart.com,*.lucid.app"

# Get all active network services
services=$(networksetup -listallnetworkservices | tail +2)

# Apply settings per service
for service in $services; do
echo "Setting proxy for: $service"
networksetup -setwebproxy "$service" "$PROXY" "$PORT"
networksetup -setsecurewebproxy "$service" "$PROXY" "$PORT"
networksetup -setproxybypassdomains "$service" $(echo $EXCLUSIONS | tr "," " ")
done

---