Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.3: Use a proxy.pac file with Panther Network
After getting squid nicely up and running, I was thinking about how to re-configure the clients to advertise the newly installed proxy. I have read before about using a so-called proxy.pac file, and to my complete surprise, Panther supports the use of a proxy.pac out of the box. This option isn't avalaible in Jaguar.

After some googling I found this site with some good information. My proxy.pac looks as follows:

 function FindProxyForURL(url, host)
   if (isPlainHostName(host) || dnsDomainIs(host, ""))
     return "DIRECT";
     return "PROXY; DIRECT";
Place the proxy.pac file in the root of your webserver. Go to System Preferences -> Network -> Proxies, and select "Automatic Proxy Configuration." Enter the URL to your proxy.pac, and there you go!
  • Currently 3.14 / 5
  You rated: 5 / 5 (7 votes cast)

10.3: Use a proxy.pac file with Panther | 6 comments | Create New Account
Click here to return to the '10.3: Use a proxy.pac file with Panther' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
..pac can be a plain file too
Authored by: avramd on Jan 19, '04 03:47:24PM

Incidentally, you do not need to be running a web server to use the .pac file. You can access it via a file:// type URL. For example (note the 3 slashes): file:///Users/username/Library/proxy.pac

[ Reply to This | # ]
Never been able to get this to work
Authored by: raider on Jan 19, '04 04:21:25PM
I have not been able to get this to work. I am running a proxy server locally (on port 9980).

If I set the "Web Proxy (HTTP)" setting to it works fine. But if I chose "Automatic Proxy Configuration" and point to my .pac file which contains:
function FindProxyForURL(url, host)
           return "PROXY; DIRECT";

Safari won't connect to anything.

What I would like to use a PAC for is so that no matter what connections will work - whether or not I have my proxy turned on (running) - which is what my PAC is suppose to do (if the PROXY is not responding, fail over to DIRECT).

[ Reply to This | # ]
Never been able to get this to work
Authored by: LightYear on Jan 19, '04 05:59:16PM
You could try Authoxy, which sets up a small locally running proxy. It is designed to authenticate to other proxies, but also offers support for PAC files. It uses libcurl to download the PAC file, so as long as the URL you specify is valid curl syntax, it should be able to download and use it. It will also provide debugging feedback to let you know if it is working.

Necessary disclaimer: I wrote Authoxy!

My .sig is on .holiday

[ Reply to This | # ]

Never been able to get this to work
Authored by: Emerge74 on Jan 20, '04 03:39:12PM

I setup on my network preference the URL necessary to load the proxy.pac; this .pac contains definitions of some sites (exceptions) that cha be accessed without usign the proxy.
When i go on this sites everything wokrs fine, when i try to connect to a site not defined in the exceptions, Safari crashes, what can i do?

[ Reply to This | # ]
Camino and .pac support
Authored by: raider on Dec 14, '04 04:30:04PM
I figured I would update this comment, since things had changed since then. I don't know which update it started working in, but now I am using 10.3.6 with Safari 1.2.4 (v125.12). The .pac file set in the network preferences works with Safari now.

I also use the same .pac file in FireFox 1.0. However Camnio 0.8.2 which normally recognizes the system proxy configuration, does not use the proxy auto config file (.pac). In order to enable the .pac for Camino you need to add a couple lines to your user.js file (usually found in your ~/Library/Application Support/Camino folder). The two lines you need to add (which will need to be customized for your setup):
user_pref("network.proxy.type", 2);
user_pref("network.proxy.autoconfig_url", "file:///Users/username/Library/proxy.pac");

Replace the "file:///Users/username/Library/proxy.pac" with the correct URL or path to your .pac file.

[ Reply to This | # ]
10.3: Use a proxy.pac file with Panther
Authored by: taobang on Apr 01, '04 10:35:32AM

i need helllppppp.
How could i set up proxy preferences thanks to ".pac" files ?
And then, is it possible to redirect the url of the browser thanks to the ".pac" file ...

an exemple would be something like that :

test.pac :

function FindProxyForURL(url, host)

if ((url.indexOf("test")>=0)) {
return "PROXY; DIRECT";


Would someone be able to help me , please ?

@+ taobang

[ Reply to This | # ]