Proxy Pac File Query

goss34
goss34 used Ask the Experts™
on
Hi All,

I currently run a pac file for some of our users and the first line is:

function FindProxyForURL(url, host)

After there are loads of other entries that i am not worried about. My query is about when a user connects to our Juniper VPN their pac file is changed to instantproxy.pac and the top entry changes to:

function FindClientProxy(url, host)

Can anyone explain what this is doing different?

The reason i am asking is because one of our in house applications accesses an internal address that has a line in the pac file that says go "DIRECT" works when the pac file says function FindClientProxy(url, host) but not with the original.

I am contemplating changing the file to use function FindClientProxy(url, host) instead of function FindProxyForURL(url, host) but want to know if this will cause problems and why i seem to have to change this to get it to work?

Hopefully this makes enough sense to someone to provide an answer.

Thanks
Dan
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
i need to see the pac file to answer the question.
direct means, no proxy.

Author

Commented:
Hi Kaerez,

Heres the pac file that doesn't work:

function FindProxyForURL(url, host)
 {
  var proxy_alpha="PROXY 0.0.0.0:80";
  var proxy_beta="PROXY 0.0.0.0:8080";
  var proxy_no="DIRECT";
  if ( dnsDomainIs ( host, "RandomDNSName.com" ) ) { return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.128")) {return proxy_heme;}
  if ( dnsDomainIs (host, "RandomDNSName.com" ) || dnsDomainIs (host, "RandomDNSName.com" ) ||   dnsDomainIs (host, "RandomDNSName.com" ) || dnsDomainIs ( host,"RandomDNSName.com" )  )
      {return proxy_heme;}
  if( isPlainHostName(host) || dnsDomainIs(host, "RandomDNSName.com") || isInNet (host, "0.0.0.0", "255.255.0.0") || dnsDomainIs(host, "RandomDNSName.com") || dnsDomainIs(host, "RandomDNSName.com") ||   dnsDomainIs(host, "RandomDNSName.com") || isInNet( host, "0.0.0.0", "255.255.0.0") || isInNet( host, "0.0.0.0", "255.255.255.0")|| dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com")  || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com")  )
     {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.255")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.255")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.0.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.128")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.128")) {return proxy_no;}
  if( isInNet(myIpAddress(),"0.0.0.0","255.255.255.128" ))
      {return proxy_no;}
  if (isInNet(myIpAddress(),"0.0.0.0","255.255.255.0"))
     return proxy_alpha;
  else
     return proxy_beta;
 }




Here is the pac file that does work:

function FindClientProxy(url, host)
 {
  var proxy_alpha="PROXY 0.0.0.0:80";
  var proxy_beta="PROXY 0.0.0.0:8080";
  var proxy_no="DIRECT";
  if ( dnsDomainIs ( host, "RandomDNSName.com" ) ) { return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.128")) {return proxy_heme;}
  if ( dnsDomainIs (host, "RandomDNSName.com" ) || dnsDomainIs (host, "RandomDNSName.com" ) ||   dnsDomainIs (host, "RandomDNSName.com" ) || dnsDomainIs ( host,"RandomDNSName.com" )  )
      {return proxy_heme;}
  if( isPlainHostName(host) || dnsDomainIs(host, "RandomDNSName.com") || isInNet (host, "0.0.0.0", "255.255.0.0") || dnsDomainIs(host, "RandomDNSName.com") || dnsDomainIs(host, "RandomDNSName.com") ||   dnsDomainIs(host, "RandomDNSName.com") || isInNet( host, "0.0.0.0", "255.255.0.0") || isInNet( host, "0.0.0.0", "255.255.255.0")|| dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com")  || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com") || dnsDomainIs ( host, "RandomDNSName.com")  )
     {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.255")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.255")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.0.0.0")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.128")) {return proxy_no;}
  if( isInNet(host, "0.0.0.0", "255.255.255.128")) {return proxy_no;}
  if( isInNet(myIpAddress(),"0.0.0.0","255.255.255.128" ))
      {return proxy_no;}
  if (isInNet(myIpAddress(),"0.0.0.0","255.255.255.0"))
     return proxy_alpha;
  else
     return proxy_beta;
 }

Thanks
Dan
Commented:
In order for a PAC file to work it MUST contain a function called "FindProxyForURL".  You can't change the name of this to something else, so the second PAC file above will do nothing and simply fail silently as this function doesn't exist.

By the sounds of it this new PAC file is being set by your VPN software - I would suggest check the VPN server and you'll probably find where you can configure the PAC file that it hands out - and either change it to match your preferred config, or some variation of the two.

Author

Commented:
Pointed me in the right direction.
Cheers

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial