Windows – Local .pac file in Firefox

firefoxPROXYwindows

I use Firefox on Windows and need a somewhat exotic proxy configuration, as I am on a network from which i must go through a proxy to reach certain sites. Some sites will not be reachable through the proxy server, and most public web sites will work, albeit performance will be poor.

Therefore, I need the inverse of the usual “connect directly to X, Y and Z, use the proxy for all others”—what I need is “use the proxy for X, Y and Z, connect directly to all others”.

To this end, I have created a .pac file with the desired rules. In Firefox’s proxy config, I have entered the URL to that file as a proxy auto-config URL. The path looks like this: file:///c:/Users/myself/Application%20Data/proxy.pac.

When I try it out, I can browse the Internet but cannot connect to sites which require going through the proxy server.

I have tried dropping the file:/// prefix, which gives the same results.

If I change the prefix to file://, Firefox will add the missing slash. If I replace %20 with a space character, Firefox will escape it again. The Reload button for the URL is available (it is grayed out if I change the URL to point to a nonexistent file). So apparently Firefox can find the file but it does not have the desired effect.

What is wrong here, or what can I try to figure out why this doesn’t work?

Best Answer

Got it.

File URLs do not seem to be a problem as of Firefox 57.0.2.

Upon examining my PAC file, I spotted a syntax error (missing closing parenthesis in an expression). After I fixed that and reloaded the PAC file (with the file:/// version of the URL), it seemed to work. I can now access the site which requires the proxy.

What I haven’t figured out yet is whether Firefox logs an error message somewhere—I spotted the syntax error by coincidence.

Related Question