Dev tools

Testing & debugging

How to validate your PAC file before deploying it to production.

pacparser — command-line PAC tester

The most reliable way to test PAC files outside a browser. Runs the full PAC evaluation engine, not a simulation.

bash — install and use pacparser
# Install (macOS)
brew install pacparser

# Install (Ubuntu / Debian)
sudo apt install pacparser

# Test a PAC file against a URL
pactester -p proxy.pac -u https://www.google.com -h www.google.com

# Expected output:
# PROXY proxy.corp.com:8080

# Test multiple URLs from a file
pactester -p proxy.pac -f urls.txt

Firefox browser debugging

Firefox exposes PAC file evaluation and alert() output in the browser console.

firefox about:config + console
# 1. Open about:config → set network.proxy.autoconfig_url to your PAC file URL
# 2. Set network.proxy.type = 2 (use PAC file)
# 3. Open DevTools → Browser Console (not page console)
# 4. alert() calls in your PAC file appear as "PAC-alert: ..." messages
# 5. Navigate to a URL and watch the console for evaluation output
PAC debug snippet (remove before deploying)
function FindProxyForURL(url, host) {
  var result = _findProxy(url, host);
  alert("PAC: " + host + " → " + result);
  return result;
}

function _findProxy(url, host) {
  if (isPlainHostName(host)) { return "DIRECT"; }
  return "PROXY proxy.corp.com:8080";
}

Chrome / macOS netlog

Chrome provides a network log viewer that shows PAC evaluation results per request.

chrome netlog
# Open chrome://net-export/ → Start Logging → browse → Stop
# Open https://netlog-viewer.appspot.com/ → load the exported JSON
# Filter events by "PAC_RESOLVE" to see per-request PAC results

# macOS: test PAC from the command line using scutil
scutil --proxy    # shows current proxy configuration

Also try the Live Tester on this page for quick in-browser validation. It simulates all PAC helper functions and evaluates your PAC file client-side — no data is sent anywhere.