Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a SOCKS proxy listening on 7070 at localhost.

Here is what my proxy.pac file looks like (to keep the test simple, I just return SOCKS proxy for all urls):

function FindProxyForURL(url, host)
{
   return "SOCKS 127.0.0.1:7070";
}

This doesn't work in Safari or Chrome. However, for other native apps like Twitter for Mac and Dropbox, this works fine.

I'm getting around it by using Firefox with the Autoproxy plugin, but I would like to use Safari. Why isn't it working?

share|improve this question
1  
hmmm... it looks like the reason is that i am using a local file. if i put it in my web server, and then put a HTTP url in the proxy setting, then it works! –  cutemic Jul 23 '11 at 6:36
    
I use a local SOCKS proxy too, and I just have it set in the "SOCKS Proxy" entry in the Proxies configuration rather than using any .pac file. Any reason not to do that? –  Kevin Reid Jul 24 '11 at 3:48
    
@KevinReid Hi Kevin, the socks proxy I am using is actually a SSH tunnel. my SSH account is a volume based subscription so i want to route only traffic that needs proxy to use SOCKS. –  cutemic Nov 12 '11 at 4:29
add comment

2 Answers

up vote 0 down vote accepted

Enable web sharing and place the PAC file (e.g. proxy.pac) in the documents folder (/Library/WebServer/Documents). Then set the auto proxy setting to http://127.0.0.1/proxy.pac. If the changes don't take effect immediately or you change the contents of the PAC file at any point in time you need to restart Safari and clear its cache. If this doesn't help, reboot the system.

share|improve this answer
add comment

Setting the file again under Automatic Proxy Configuration after entering any junk URL seems to re-read the file for me.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.