View Full Version: Creating a PAC

FoxyProxy > Help and Support > Creating a PAC


Title: Creating a PAC


stephen_wq - December 2, 2006 08:36 AM (GMT)
Contents of PAC file:
CODE
[I]proxy.pac[/I]
function FindProxyForURL(url, host){
 if (shExpMatch(myIpAddress(), "172.*.*.*") {
   return "PROXY igate:8080;"
 }
 else {
   return "DIRECT";
 }
}

Doesn't work:
user posted image
Don't have any idea why.
What i am trying to accomplish is to check if the ip address is 172.*.*.*, and if it is, use the proxy igate on port 8080, for all ports, just like you can when setting up a proxy.
If it isnt, just use the normal direct connection.

Eric H. Jung - December 2, 2006 05:16 PM (GMT)
Hi Stephen,

You're missing a parenthesis. Change:

CODE
if (shExpMatch(myIpAddress(), "172.*.*.*") {


to:

CODE
if (shExpMatch(myIpAddress(), "172.*.*.*")) {


If you read the error message carefully, it tells you the problem: [JavasScript Error: "missing ) after condition ...

HTH,
Eric




* Hosted for free by InvisionFree