Cisco Cisco ScanSafe Wi-Fi Hotspot Security White Paper

Página de 17
Cisco CWS 
– Standalone Deployment Guide 
 
 
 
Test 
Deploy 
Prepare 
Deploy 
 
Redirect web traffic 
The following sections will explain how to redirect web traffic to the cloud using a PAC file. PAC files are 
used to determine whether to forward a web request to a particular proxy or to send web requests out 
directly from the client.   
This document is intended to provide an overview of the deployment process. For more detailed 
information and troubleshooting, please refer to th
. 
Configure a PAC file 
The inner working of a PAC file is JavaScript. Although no script experience is required to craft a PAC file, 
it is beneficial to understand the fundamentals of how JavaScript works. 
Reference video
JavaScript is a cross-platform scripting language usable on Windows, Mac and Linux. As JavaScript is 
case sensitive, one must use caution when creating and modifying PAC files. Any errors in the PAC file 
will prevent the PAC file from being read. The browser will simply ignore the PAC file and fail open. A 
browser that is failed open acts normally, as if no PAC file was configured in the browser at all. 
JavaScript Conventions 
Description 
// (double forward slashes) 
a comment; text that is preceded by these characters 
will not be read 
() (open and closed 
parentheses) 
contain arguments for a function 
{} (curly brackets) 
encapsulates arguments and functions within a 
function, supersedes parentheses, and cannot be 
contained within parentheses 
|| (double pipes) 
a logical OR statement; allows the script to evaluate 
more than one condition in a function 
; (semi-colon) 
ends a function, like the period in a sentence 
Chart 2.1 
A variable is a means of dynamically representing a numeric character value. A variable’s value may 
change each time the PAC file runs. 
Declare a variable using the following: var VARIABLE_NAME=SOME_VALUE; 
Overview of JavaScript Functions 
FindProxyForURL
(
url, host
)
– overall function governing for the PAC file itself. Web browsers look for 
this function when configured to use a PAC file. The value for the two variables enclosed by the 
parentheses is defined by the browser. You do not need to define them.