User Tools

Site Tools


howto:firefox-proxy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:firefox-proxy [2025/08/13 22:48] Wulf Rajekhowto:firefox-proxy [2025/08/14 15:16] (current) Wulf Rajek
Line 1: Line 1:
-====== Firefox Proxy ======+====== Firefox/Chrome Proxy ======
  
-To use a proxy for specific sites only, the easiest option is to create a pac file and configure Firefox to use it as automatic proxy configuration.+To use a proxy for specific sites only, the easiest option is to create a pac file and configure Firefox/Chrome to use it as automatic proxy configuration.
  
 Example pac file: Example pac file:
Line 9: Line 9:
         return "HTTP 192.168.0.1:8888";         return "HTTP 192.168.0.1:8888";
     }     }
 +}
 +</code>
 +
 +Possible option to identify network to only use proxy if in home network or private ip range:
 +<code>
 +function FindProxyForURL(url, host) {
 +    var myIP = myIpAddress();
 +
 +    // Detect by IP range (example: 192.168.1.x) or DNS suffix (example: home.lan)
 +    if (
 +        isInNet(myIP, "192.168.1.0", "255.255.255.0") ||
 +        dnsDomainIs(host, ".home.lan")
 +    ) {
 +        return "PROXY proxy.example.com:8080";
 +    }
 +
 +    // Otherwise, no proxy
 +    return "DIRECT";
 } }
 </code> </code>
Line 14: Line 32:
 Store this somewhere and go to about:preferences -> general -> Network settings (very bottom) -> settings, select "Automatic proxy configuration URL" and enter the path to the pac file in the file protocol notation, e.g.: Store this somewhere and go to about:preferences -> general -> Network settings (very bottom) -> settings, select "Automatic proxy configuration URL" and enter the path to the pac file in the file protocol notation, e.g.:
 <code> <code>
-file:///home/user/.mozilla/firefox/ffox.default/custom_proxies.pac+file:///home/user/.config/custom_proxies.pac
 </code> </code>
  
Line 21: Line 39:
 Further info: Further info:
 [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file|Mozilla Dev]] [[https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Proxy_servers_and_tunneling/Proxy_Auto-Configuration_PAC_file|Mozilla Dev]]
 +
 +Chrome/Chromium:
 +These browsers use the system proxy settings and do not have a GUI option to set custom proxies. Proxies and bypass urls need to be set via command line:
 +<code>
 +--proxy-server="foopy:8080" --proxy-bypass-list="*.google.com;*foo.com;127.0.0.1:8080"
 +--proxy-pac-url="http://wpad/windows.pac"
 +</code>
howto/firefox-proxy.1755121699.txt.gz · Last modified: by Wulf Rajek