cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1027
Views
0
Helpful
2
Replies

PAC file entry

aravinda099
Level 1
Level 1

Hi ,

I have an issue with a PAC file used in a Cisco Iron-port device. 

I need to  add an entry into the PAC file for an internal application used via an IP from web browser. When I add it in to the file I cannot seem to get it to working. I need it to bypass the proxy and access direct. 

PAC file is as per below 

 

function FindProxyForURL(url, host)
{
if (
dnsDomainIs(host, "rplocal")|| 
dnsDomainIs(host, "example1.com")|| 
dnsDomainIs(host, ".example2.com") ||
                isInNet(host, "10.10.10.1", "255.255.255.255")
shExpMatch(host,"*rplocal*"))
{     
return "DIRECT";
}
return "PROXY 10.10.10.10:3128";
}

 

2 Replies 2

Tao Yang
Cisco Employee
Cisco Employee

http://findproxyforurl.com/example-pac-file/ is a quite good website for PAC file coding.

Please refer to the following example in that page to fix your issue.

 

function FindProxyForURL(url, host) {
 
// If the hostname matches, send direct.
    if (dnsDomainIs(host, ".intranet.domain.com") ||
        shExpMatch(host, "(*.abcdomain.com|abcdomain.com)"))
        return "DIRECT";
 
// If the protocol or URL matches, send direct.
    if (url.substring(0, 4)=="ftp:" ||
        shExpMatch(url, "http://abcdomain.com/folder/*"))
        return "DIRECT";
 
// If the requested website is hosted within the internal network, send direct.
    if (isPlainHostName(host) ||
        shExpMatch(host, "*.local") ||
        isInNet(dnsResolve(host), "10.0.0.0", "255.0.0.0") ||
        isInNet(dnsResolve(host), "172.16.0.0",  "255.240.0.0") ||
        isInNet(dnsResolve(host), "192.168.0.0",  "255.255.0.0") ||
        isInNet(dnsResolve(host), "127.0.0.0", "255.255.255.0"))
        return "DIRECT";
 
// If the IP address of the local machine is within a defined
// subnet, send to a specific proxy.
    if (isInNet(myIpAddress(), "10.10.5.0", "255.255.255.0"))
        return "PROXY 1.2.3.4:8080";
 
// DEFAULT RULE: All other traffic, use below proxies, in fail-over order.
    return "PROXY 4.5.6.7:8080; PROXY 7.8.9.10:8080";
 
}

 

Hope it helps.

Hi Tao,

I did come across this page and tried as suggested but wasnt able to get it working.