1

OS version: OS X 10.8.2
PAC file path: http://localhost/proxy.pac
Target applications: Safari, Tweetbot
Example rule in .pac:

if (shExpMatch(url, '*domain.com*')) return 'SOCKS5 127.0.0.1:8080';

In Chrome, the SOCKS5 proxy works perfectly, but Safari/Tweetbot just can't access the matched URL.

It looks like the server of matched URL is down for Safari/Tweetbot.

I took a look at logs in Console.app, but everything is fine.

I wonder if there's a way to make .pac works for sandboxed application?

Chris
  • 121

2 Answers2

1

OK, I figured out how to fix this problem, write rule like this:

if (shExpMatch(url, '*domain.com*')) return 'SOCKS5 127.0.0.1:8080;SOCKS 127.0.0.1:8080';

Or setup a HTTP proxy with Privoxy, then write rule like this:

if (shExpMatch(url, '*domain.com*')) return 'PROXY 127.0.0.1:8118';

8118 is the default port for Privoxy.

I prefer the second way, it seems more stable though I haven't prove it yet.

Indrek
  • 24,874
Chris
  • 121
0

Because of unknown reasons, from now on you should setup the proxy server in System Network Settings first and than you can use your PAC file as usual.

In other words, check both Autoproxy and Socksproxy in System Network Settings.

Indrek
  • 24,874