Jump to content

Recommended Posts

Posted

Hi Is there anyone here who can help me create a pac file??

 

Basically want my Ipads to by-pass the proxy ... for i.e Spice works and other local systems etc...

 

Thanks

 

Si

  • 3 weeks later...
Posted (edited)

A useful website for reference is here - FindProxyForURL

 

I would of thought you could use a rule which checks the browser header for iPad however to the best of my knowledge I don't believe WPAD/Pac files support this :(

 

Example WPAD file for you

//Pac File
function FindProxyForURL(url, host)
{
//Setting the proxy variables
var proxy_yes = "PROXY 10.1.1.254:8881";
var proxy_no = "DIRECT";
var resolved_ip = dnsResolve(host);
var myip = myIpAddress();
//Debug Info
//alert("My Addr: " + myIpAddress() + "\nURL: " + url + "\nHost: " + host);
// All ftp requests go DIRECT - can be adapted for other protocols 
if (url.substring(0, 4) == "ftp:") {
   return proxy_no;
   }
//Bypass for local domains
   if (shExpMatch( host, "127.*" )
   ||  shExpMatch( host, "localhost" )
   ||  shExpMatch( host, "*.domain.com" )
   ||  shExpMatch( host, "*.domain.co.uk" )
   ||  isPlainHostName( host )
   ||  dnsDomainIs( host, ".domain.co.uk")
   ||  dnsDomainIs( host, ".domain.com)) {
      return proxy_no; 
   }
//If you are on the 10.111.x.x network use the proxy
if (isInNet(myip, "10.111.0.0", "255.255.0.0"))
       {
       return proxy_yes;
       }
//if not browse direct
else    {
       return proxy_no;
       }
}

 

You can test your PAC/WPAD files using pactester very useful for finding errors - http://code.google.com/p/pactester/

 

Cheers!

Edited by grant_girdwood

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...