Due to the existence of Greal Firewall, I have a terribly long
proxy.pac file. Apparently, how to maintain that becomes a problem. Regularly, I use git to keep a “stable” version and make updates on it.
Recently I just found the script stop working for no good reason, because the proxy server I’m using is working, and I tried manually choose a proxy server (by entering its address and port into my browser directly) it also worked, so apparently there is something wrong with the script.
However, it has been a while since I last commit my changes to this script back to git. So there are some changes I wish to keep and I don’t want to do a binary search to find out the problem (Yep, I’m a lazy guy).
So I installed it and did one test:
$ pactester -p ~/Documents/Miscs/proxy.pac -u 'http://blog.iphone-dev.org'
Use of uninitialized value in numeric ne (!=) at pactester line 137.
Error: SyntaxError: missing ) after condition at line 98:
if (dnsDomainIs(host, "cubes.fr") return "SOCKS 127.0.0.1:7777";
So that’s the problem. Fixed it, everything is back to normal again!
That’s a small tip on debugging a complex pac script, hope it helps.