Mac – Why does “file:///Users/username/Library/proxy.pac” not work in MacOS

httpmacmac-osxpacPROXY

I tested setting up a proxy.pac file via a web server:

networksetup -setautoproxyurl "Wi-Fi" "http://localhost/proxy.pac"

and via a file directly:

networksetup -setautoproxyurl "Wi-Fi" "file:///Users/username/Library/proxy.pac"

The web server method works (provided I arrange that the proxy.pac is served by a webserver). The file server doesn't work.

What's the problem, fundamentally?

Motivation for the question is, I'd like to simplify and prefer to not have to run an http server.

Best Answer

It sounds like you didn't (force) reload it. Run the following commands:

networksetup -setautoproxystate Wi-Fi off

networksetup -setautoproxystate Wi-Fi on

Let me know how it works out for you.