+ Post New Thread
Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
Internet Related/Filtering/Firewall Thread, WPAD in Technical; Yeap, done that one too. I have had a look and found an extra } that shouldnt have been in ...
  1. #16
    cmpwat's Avatar
    Join Date
    Dec 2011
    Location
    Gloucester
    Posts
    42
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Yeap, done that one too. I have had a look and found an extra } that shouldnt have been in there and removed it. the wpad is working for my Surface (win8.1) my iPad and iPhone but not on PCs. Also, I need to add a line the ignore local servers as I cannot get on PaperCut for example.

  2. #17

    Join Date
    Nov 2013
    Posts
    47
    Thank Post
    5
    Thanked 11 Times in 4 Posts
    Rep Power
    4
    This is what I have and it works:

    function FindProxyForURL(url, host)
    {

    if (isInNet(myIpAddress(), "10.0.0.0", "255.0.0.0"))
    {
    if (shExpMatch(host,"10.*") ||
    shExpMatch(host,"*.myvle.org") ||
    shExpMatch(host,"pceconsole.bham.org.uk") ||
    shExpMatch(host,"pceconsole2.bham.org.uk") ||
    shExpMatch(host,"*.misportal.net") ||
    shExpMatch(host,"*.bgfl.org") ||
    shExpMatch(host,"*.bgfl.eu"))
    {
    return "DIRECT";
    }
    else
    {
    return "PROXY eduproxy.bgfl.org:80";
    }
    }
    else
    {
    return "DIRECT";
    }


    }
    The reason its more complicated than normal is that I need it to work for laptops and PCs on and off site.

  3. #18

    Join Date
    Jan 2008
    Location
    South West
    Posts
    1,842
    Thank Post
    219
    Thanked 271 Times in 219 Posts
    Rep Power
    69
    This is the wpad from my isa server:

    Code:
    //Copyright (c) 1997-2006 Microsoft Corporation
    BackupRoute="DIRECT";
    UseDirectForLocal=true;
    function MakeIPs(){
    }
    DirectIPs=new MakeIPs();
    cDirectIPs=0;
    function MakeCARPExceptions(){
    }
    CARPExceptions=new MakeCARPExceptions();
    cCARPExceptions=0;
    function MakeNames(){
    this[0]="dcc-sch.4505.local";
    }
    DirectNames=new MakeNames();
    cDirectNames=1;
    HttpPort="8080";
    cNodes=1;
    function MakeProxies(){
    this[0]=new Node("ISA.DCC-SCH-4505.local",0,1.000000);
    }
    Proxies = new MakeProxies();
    function Node(name, hash, load){
     this.name = name;
     this.hash = hash;
     this.load = load;
     this.score = 0;
     return this;
    }
    function FindProxyForURL(url, host){
     var hash=0, urllower, i, fIp=false, ip, nocarp=false, skiphost=false;
     var list="", pl, j, score, ibest, bestscore;
     urllower = url.toLowerCase();
     if((urllower.substring(0,5)=="rtsp:") ||
       (urllower.substring(0,6)=="rtspt:") ||
       (urllower.substring(0,6)=="rtspu:") ||
       (urllower.substring(0,4)=="mms:") ||
       (urllower.substring(0,5)=="mmst:") ||
       (urllower.substring(0,5)=="mmsu:"))
      return "DIRECT";
     if(UseDirectForLocal){
      if(isPlainHostName(host))
       fIp = true;}
     for(i=0; i<cDirectNames; i++){
      if(shExpMatch(host, DirectNames[i])){
       fIp = true;
       break;}
      if(shExpMatch(url, DirectNames[i]))
       return "DIRECT";
     }
     if(cDirectIPs == 0){
      if(fIp)
       return "DIRECT";}
     else{
      ip = host;
      if(fIp)
       ip = dnsResolve(host);
      var isIpAddr = /^(\d+.){3}\d+$/;
      if(isIpAddr.test(ip)){
       for(i=0; i<cDirectIPs; i += 2){
        if(isInNet(ip, DirectIPs[i], DirectIPs[i+1]))
         return "DIRECT";}}
      else if(isPlainHostName(host))
       return "DIRECT";
     }
     if(cCARPExceptions > 0){
      for(i = 0; i < cCARPExceptions; i++){
       if(shExpMatch(host, CARPExceptions[i])){
        nocarp = true;}
       if(shExpMatch(url, CARPExceptions[i])){
        nocarp = true;
        skiphost = true;
        break;
     }}}
     if(!skiphost)
      hash = HashString(host,hash);
     if(nocarp)
      hash = HashString(myIpAddress(), hash);
     pl = new Array();
     for(i = 0; i<cNodes; i++){
      Proxies[i].score = Proxies[i].load * Scramble(hash ^ Proxies[i].hash);
      pl[i] = i;
     }
     for(j = 0; j < cNodes; j++){
      bestscore = -1;
      for(i = 0; i < cNodes-j; i++){
       score = Proxies[pl[i]].score;
       if(score > bestscore){
        bestscore = score;
        ibest = i;
      }}
      list = list + "PROXY " + Proxies[pl[ibest]].name + ":" + HttpPort + "; ";
      pl[ibest] = pl[cNodes-j-1];
     }
     list = list + BackupRoute;
     return list;
    }
    var h_tbl = new Array(0,0x10D01913,0x21A03226,0x31702B35,0x4340644C,0x53907D5F,0x62E0566A,0x72304F79,0x8680C898,0x9650D18B,0xA720FABE,0xB7F0E3AD,0xC5C0ACD4,0xD510B5C7,0xE4609EF2,0xF4B087E1);
    function HashString(str, h){
      for(var i=0; i<str.length; i++){
       var c = str.charAt(i);
       if(c ==':' || c == '/') break;
       c = CharToAscii(c.toLowerCase());
       h = (h >>> 4) ^ h_tbl[(h ^ c) & 15];
       h = (h >>> 4) ^ h_tbl[(h ^ (c>>>4)) & 15];
       h = MakeInt(h);
     }
     return h;
    }
    function Scramble(h){
     h += ((h & 0xffff) * 0x1965) + ((((h >> 16) & 0xffff) * 0x1965) << 16) + (((h & 0xffff) * 0x6253) << 16);
     h = MakeInt(h);
     h += (((h & 0x7ff) << 21) | ((h >> 11) & 0x1fffff));
     return MakeInt(h);
    }
    var Chars =" !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~???????????????????????? ";
    function CharToAscii(c){
     return Chars.indexOf(c) + 32;
    }
    function MakeInt(x){
     x %= 4294967296;
     if(x < 0)
      x += 4294967296;
     return x;
    }
    it seems to cover everything! Adjust as needed



SHARE:
+ Post New Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. WPAD File, Auto Detect Proxy Server
    By steveo2000 in forum Windows Server 2000/2003
    Replies: 6
    Last Post: 14th July 2010, 02:40 PM
  2. ISA + WPAD + 403 Forbidden
    By Nick_Parker in forum Internet Related/Filtering/Firewall
    Replies: 0
    Last Post: 1st October 2009, 10:22 AM
  3. WPAD Issues
    By gsk in forum Internet Related/Filtering/Firewall
    Replies: 7
    Last Post: 21st May 2009, 03:04 PM
  4. Replies: 2
    Last Post: 23rd February 2008, 06:17 PM
  5. WPAD.DAT
    By k-strider in forum Coding
    Replies: 0
    Last Post: 4th July 2007, 04:12 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •