Jump to content

Recommended Posts

Posted

Hi All

 

I am having some issues with internal IP Address in my Pac File.

 

In the pac file the main address's work fine, 10.#.#.#, getting to printers in a web browser is not a problem.

 

But our VOIP has its own 192.168.0.# range, but this is not working. We have added two different coding in the file and neither work. I just get a search in Google

 

1st

 

dnsDomainIs(host, "192.168.0.*") ||

 

2nd

 

url.substring(0,10)=="http://192.168.0.*" ||

 

The 10 range works with the code below

 

url.substring(0,10)=="http://10." | |

 

Any thoughts please?

 

the url.substring code was supplied by BGFL. The dnsDomainIs was in the original file we used. Just not get the 192 addresses to work

 

Thanks

 

Phil

Posted

url.substring(0,10)=="http://192.168.0.*" will never match - as the second string is longer than 10 characters. Needs to be 0,17.

 

Should probably be using "isinnet" tho...

Posted

this is the file we was sent

 

//start

function FindProxyForURL(url, host)

{

if (isPlainHostName(host) ||

dnsDomainIs(host, "*.arthurterry.bham.sch.uk") ||

dnsDomainIs(host, ".bgfl.org") ||

dnsDomainIs(host, ".bgfl.eu") ||

dnsDomainIs(host, "myvle.org") ||

dnsDomainIs(host, "*misportal.net") ||

dnsDomainIs(host, "ats-ls01*") ||

dnsDomainIs(host, "ats-isa01*") ||

dnsDomainIs(host, "internet*") ||

dnsDomainIs(host, "intranet*") ||

dnsDomainIs(host, "192.168.0.*") ||

url.substring(0,10)=="http://10." ||

url.substring(0,18)=="http://192.168.0.*" ||

url.substring(0,11)=="https://10." ||

url.substring(0,9)=="ftp://10."

)

return "DIRECT"; //go direct

else

return "PROXY eduproxy.bgfl.org:80"

}

//end

 

 

this is our original file which we used

 

function FindProxyForURL(url, host) {

if ( isInNet(host, "10.134.32.0", "255.255.240.0") ||

dnsDomainIs(host,"https://webmail.arthurterry.bham.sch.uk") ||

dnsDomainIs(host,"http://www.arthurterry.bham.sch.uk") ||

dnsDomainIs(host,"ats-ls01.local.arthurterry.bham.sch.uk") ||

dnsDomainIs(host,"ats-ls01") ||

dnsDomainIs(host,"ats-isa01") ||

dnsDomainIs(host,"arthurterry.misportal.net") ||

dnsDomainIs(host,"intranet.local.arthurterry.bham.sch.uk") ||

dnsDomainIs(host,"intranet") ||

dnsDomainIs(host,"sharepoint.local.arthurterry.bhams.sch.uk") ||

dnsDomainIs(host,"sharepoint.arthurterry.bhams.sch.uk") ) {

return "DIRECT";

}

else {

return "PROXY eduproxy.bgfl.org:80";

}

}

 

any advice?

Posted

None of your "*" ones will work.

Think carefully about what you are asking - substr takes a portion of the string - you are saying "are the first 18 characters of the URL equal to "http://192.168.0.*" - which they will never be, the * there is literal. Try "are the first 15 characters equal to "http://192.168." instead

url.substring(0,15)=="http://192.168."

 

isInNet is the proper way to do it for IPs... you'll still need to "deal with" DNS names though - the browser doesn't resolve them - one of your examples takes a stab here:

isInNet(host, "10.134.32.0", "255.255.240.0")

 

That's fairly specific

isInNet(host, "10.0.0.0", "255.0.0.0")

 

would catch all 10. addresses

 

and

isInNet(host, "192.168.0.0", "255.255.0.0")

 

would catch all 192 addresses.

dnsDomainIs(host, "myvle.org") || 

 

looks suspiciously like an example

 

dnsDomainIs(host, "*misportal.net") || 

 

* won't work - replace it with a . to match all subdomains of misportal.net

 

 

dnsDomainIs(host, "ats-ls01*") ||
dnsDomainIs(host, "ats-isa01*") ||
dnsDomainIs(host, "internet*") ||
dnsDomainIs(host, "intranet*") || 

 

These are fixable - but I won't tell you how until you tell me why :) Its a really bad idea to put in prefixes - it could cause you all sorts of grief.

 

If you can give a good list of what you need to go direct, and what needs to go proxy, we may be able to help draw up a less confused proxy.pac

  • Thanks 3
Posted

hi tom

 

Thats really useful information to help

 

What do i need to add to allow 192 address as well as 10.134 address's

 

Had a play to use 2 inisnet for 10.134 and 192, but it didnt work :o

 

i guess it didnt work

 

thanks

 

Phil

Posted

Bah. Had to make this "clever" didn't I ;)

 

This will go direct for:

plain hosts (eg one word hosts like http://vle)

10.xx.xx.xx IPs

192.168.xx.xx IPs

anything ending bgfl.eu or bgfl.org

 

you can add new "endings" by adding another "push" line

 

Not tested in the wild, just with google's pactester.

 

function FindProxyForURL(url, host)
{
       if (isPlainHostName(host))
               return "DIRECT";
       if (isInNet(host,"192.168.0.0","255.255.0.0"))
               return "DIRECT";
       if (isInNet(host,"10.0.0.0","255.0.0.0"))
               return "DIRECT";
       var endings = new Array();
       endings.push(".bgfl.org");
       endings.push(".bgfl.eu");
       var t;
       for (t in endings)
       {
               if (host.match(endings[t] + "$"))
                       return "DIRECT";
       }
       return "PROXY eduproxy.bgfl.org:80";
}

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...