sample PAC file - Tahaan/proxymanager GitHub Wiki
- Copy the below code to a text file.
- Edit the Network address and Mask to match your requirements.
- Check and update the Proxy server and port returned.
- Save the file, eg ~/.mozilla/proxy.pac
- Configure Firefox to use this file as PAC file by entering the file path in the Automatic Proxy Configuration URL under the Connection Settings.
function FindProxyForURL(url, host) { if (isInNet(myIpAddress(), "172.18.0.0", "255.255.0.0")) return "PROXY localhost:3128"; else return "DIRECT"; }
-
The format for the Proxy Auto Configuration URL file path is:
file:///home/username/.mozilla/proxy.pac
-
The PAC file is not automatically read when it is changed, you need to manually "Reload" the file from the Connection Settings screen.
-
Errors in this file causes the PAC file to be silently ignored and a DIRECT connection will then be attempted.