The PAC (Proxy Auto-Config) endpoint serves JavaScript files that browsers and systems use to automatically configure proxy settings for private.yourdomain.com.
Endpoint: https://private.yourdomain.com/proxy.pac
curl https://private.yourdomain.com/proxy.pac?user=tamecalmcurl "https://private.yourdomain.com/proxy.pac?user=tamecalm&pass=yourpassword"curl "https://private.yourdomain.com/proxy.pac?token=abc1234&user=tamecalm"| Parameter | Required | Description |
|---|---|---|
user |
Yes* | Username for the proxy. Required unless PAC_DEFAULT_USER is set |
pass |
No | Password to embed in PAC file. If omitted, browser will prompt |
token |
No | Required only if PAC_TOKEN environment variable is set |
Content-Type: application/x-ns-proxy-autoconfig
Cache-Control: no-cache, no-store, must-revalidate
Access-Control-Allow-Origin: *function FindProxyForURL(url, host) {
// Don't proxy local addresses
if (isPlainHostName(host) ||
shExpMatch(host, "*.local") ||
isInNet(host, "192.168.0.0", "255.255.0.0") ||
isInNet(host, "10.0.0.0", "255.0.0.0") ||
isInNet(host, "172.16.0.0", "255.240.0.0") ||
host == "localhost" ||
host == "127.0.0.1") {
return "DIRECT";
}
// Route through private.yourdomain.com proxy
return "PROXY tamecalm:[email protected]:8080; SOCKS5 tamecalm:[email protected]:1080; DIRECT";
}- System Preferences → Network → Select connection → Advanced
- Proxies tab → Check Automatic Proxy Configuration
- URL:
https://private.yourdomain.com/proxy.pac?user=YOUR_USER
- Settings → Network & Internet → Proxy
- Enable Use setup script
- Script address:
https://private.yourdomain.com/proxy.pac?user=YOUR_USER
- Settings → Wi-Fi → Tap (i) on your network
- Configure Proxy → Automatic
- URL:
https://private.yourdomain.com/proxy.pac?user=YOUR_USER
- Settings → Network Settings → Settings...
- Select Automatic proxy configuration URL
- Enter:
https://private.yourdomain.com/proxy.pac?user=YOUR_USER
Configure at OS level (Windows/macOS settings above)
| Status | Cause |
|---|---|
| 401 | Invalid token (when PAC_TOKEN is configured) |
| 401 | Invalid credentials (when pass parameter provided but wrong) |
| 429 | Rate limit exceeded |
Add to /opt/proxy/.env:
# Enable PAC endpoint
PAC_ENABLED=true
# Optional: Require token for PAC access
PAC_TOKEN=
# Optional: Default user if no ?user= param
PAC_DEFAULT_USER=tamecalm
# Rate limit (requests per minute)
PAC_RATE_LIMIT_RPM=60After changing, restart the service:
sudo systemctl restart proxy