Skip to main content
Version: 2.9.0

Configure Proxy and Exclusions on macOS (with WebSocket Support Notes)

This guide explains how to configure proxy settings and exclusions on macOS using an IP-based proxy and exclusion list. It includes exclusions for apps that use WebSockets, such as:

  • Slack
  • Lucidchart
  • Figma

These tools often break behind proxies like Squid, which do not support WebSockets by default.

Manual Method (System Settings)​

  1. Go to System Settings → Network
  2. Choose your active interface (e.g., Wi-Fi)
  3. Click Details → Proxies
  4. Under Web Proxy (HTTP) and Secure Web Proxy (HTTPS):
    • Replace proxy.company.com with your proxy IP (e.g., 192.168.1.10)
    • Set port (commonly 8080)
  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 with networksetup and 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

---