Cisco Cisco Web Security Appliance S360 故障排查指南

下载
页码 1
How to test a PAC file?
Document ID: 118083
Contributed by Vladimir Sousa and Siddharth Rajpathak, Cisco TAC
Engineers.
Jul 25, 2014
Contents
Question:
Question:
How to test a PAC file?
Environment: Cisco Web Security appliance (WSA), Explicit mode, PAC file
PAC file errors are usually not displayed by Browsers like Internet Explorer, Firefox etc. These errors can be
syntax or logic related.
It is possible to troubleshoot the syntax and logic of a PAC file using a simple Java function: Alerts()
The example below shows how to apply this function to determine whether or not the PAC file was processed
and which of my "if" statement was matched:
function FindProxyForURL(url, host)
{
      javascript:alert ("Inside the function");
            if (isInNet(host, "200.0.0.0", "255.0.0.0")) 
           {
                  javascript:alert ("Inside 1st if");
                 return "PROXY 10.49.217.162:80";
           }
           if (isInNet(host, "210.0.0.0", "255.0.0.0")) 
           {
                  javascript:alert ("Inside 2nd if");
                  return "PROXY 10.49.217.162:80";
           }
           else return "DIRECT";
}
Note: This could be useful to troubleshoot more advanced PAC file scripts that are performing load balancing
for instance.
Updated: Jul 25, 2014
Document ID: 118083