sippo Posted July 19, 2013 Posted July 19, 2013 We have just taken delivery of a new Ruckus Zone Director, and I want to enable auto proxy configuration. Does anyone have a copy of a wpad.dat I could possibly edit to use? Much Appreciated!!
hogwam Posted July 22, 2013 Posted July 22, 2013 //Copyright © 1997-2006 Microsoft Corporation BackupRoute="DIRECT"; UseDirectForLocal=true; function MakeIPs(){ this[0]="127.0.0.0"; this[1]="255.0.0.0"; this[2]="0.0.0.1"; this[3]="255.255.255.255"; this[4]="0.0.0.2"; this[5]="255.255.255.254"; this[6]="0.0.0.4"; this[7]="255.255.255.252"; this[8]="0.0.0.8"; this[9]="255.255.255.248"; this[10]="0.0.0.16"; this[11]="255.255.255.240"; this[12]="0.0.0.32"; this[13]="255.255.255.224"; this[14]="0.0.0.64"; this[15]="255.255.255.192"; this[16]="0.0.0.128"; this[17]="255.255.255.128"; this[18]="0.0.1.0"; this[19]="255.255.255.0"; this[20]="0.0.2.0"; this[21]="255.255.254.0"; this[22]="0.0.4.0"; this[23]="255.255.252.0"; this[24]="0.0.8.0"; this[25]="255.255.248.0"; this[26]="0.0.16.0"; this[27]="255.255.240.0"; this[28]="0.0.32.0"; this[29]="255.255.224.0"; this[30]="0.0.64.0"; this[31]="255.255.192.0"; this[32]="0.0.128.0"; this[33]="255.255.128.0"; this[34]="0.1.0.0"; this[35]="255.255.0.0"; this[36]="0.2.0.0"; this[37]="255.254.0.0"; this[38]="0.4.0.0"; this[39]="255.252.0.0"; this[40]="0.8.0.0"; this[41]="255.248.0.0"; this[42]="0.16.0.0"; this[43]="255.240.0.0"; this[44]="0.32.0.0"; this[45]="255.224.0.0"; this[46]="0.64.0.0"; this[47]="255.192.0.0"; this[48]="0.128.0.0"; this[49]="255.128.0.0"; this[50]="1.0.0.0"; this[51]="255.0.0.0"; this[52]="2.0.0.0"; this[53]="254.0.0.0"; this[54]="4.0.0.0"; this[55]="252.0.0.0"; this[56]="8.0.0.0"; this[57]="248.0.0.0"; this[58]="16.0.0.0"; this[59]="240.0.0.0"; this[60]="32.0.0.0"; this[61]="224.0.0.0"; this[62]="64.0.0.0"; this[63]="224.0.0.0"; this[64]="96.0.0.0"; this[65]="240.0.0.0"; this[66]="112.0.0.0"; this[67]="248.0.0.0"; this[68]="120.0.0.0"; this[69]="252.0.0.0"; this[70]="124.0.0.0"; this[71]="254.0.0.0"; this[72]="126.0.0.0"; this[73]="255.0.0.0"; this[74]="10.72.0.1"; this[75]="255.255.255.255"; this[76]="10.72.0.2"; this[77]="255.255.255.254"; this[78]="10.72.0.4"; this[79]="255.255.255.252"; this[80]="10.72.0.8"; this[81]="255.255.255.248"; this[82]="10.72.0.16"; this[83]="255.255.255.240"; this[84]="10.72.0.32"; this[85]="255.255.255.224"; this[86]="10.72.0.64"; this[87]="255.255.255.192"; this[88]="10.72.0.128"; this[89]="255.255.255.128"; this[90]="10.72.1.0"; this[91]="255.255.255.0"; this[92]="10.72.2.0"; this[93]="255.255.254.0"; this[94]="10.72.4.0"; this[95]="255.255.252.0"; this[96]="10.72.8.0"; this[97]="255.255.248.0"; this[98]="10.72.16.0"; this[99]="255.255.240.0"; this[100]="10.72.32.0"; this[101]="255.255.224.0"; this[102]="10.72.64.0"; this[103]="255.255.192.0"; this[104]="10.72.128.0"; this[105]="255.255.128.0"; this[106]="128.0.0.0"; this[107]="192.0.0.0"; this[108]="192.0.0.0"; this[109]="224.0.0.0"; this[110]="240.0.0.0"; this[111]="248.0.0.0"; this[112]="248.0.0.0"; this[113]="252.0.0.0"; this[114]="252.0.0.0"; this[115]="254.0.0.0"; this[116]="254.0.0.0"; this[117]="255.0.0.0"; this[118]="255.0.0.0"; this[119]="255.128.0.0"; this[120]="255.128.0.0"; this[121]="255.192.0.0"; this[122]="255.192.0.0"; this[123]="255.224.0.0"; this[124]="255.224.0.0"; this[125]="255.240.0.0"; this[126]="255.240.0.0"; this[127]="255.248.0.0"; this[128]="255.248.0.0"; this[129]="255.252.0.0"; this[130]="255.252.0.0"; this[131]="255.254.0.0"; this[132]="255.254.0.0"; this[133]="255.255.0.0"; this[134]="255.255.0.0"; this[135]="255.255.128.0"; this[136]="255.255.128.0"; this[137]="255.255.192.0"; this[138]="255.255.192.0"; this[139]="255.255.224.0"; this[140]="255.255.224.0"; this[141]="255.255.240.0"; this[142]="255.255.240.0"; this[143]="255.255.248.0"; this[144]="255.255.248.0"; this[145]="255.255.252.0"; this[146]="255.255.252.0"; this[147]="255.255.254.0"; this[148]="255.255.254.0"; this[149]="255.255.255.0"; this[150]="255.255.255.0"; this[151]="255.255.255.128"; this[152]="255.255.255.128"; this[153]="255.255.255.192"; this[154]="255.255.255.192"; this[155]="255.255.255.224"; this[156]="255.255.255.224"; this[157]="255.255.255.240"; this[158]="255.255.255.240"; this[159]="255.255.255.248"; this[160]="255.255.255.248"; this[161]="255.255.255.252"; this[162]="255.255.255.252"; this[163]="255.255.255.254"; this[164]="255.255.255.254"; this[165]="255.255.255.255"; } DirectIPs=new MakeIPs(); cDirectIPs=166; function MakeCARPExceptions(){ } CARPExceptions=new MakeCARPExceptions(); cCARPExceptions=0; function MakeNames(){ this[0]="*.hesleyinfo.net"; this[1]="hesleyinfo.net"; } DirectNames=new MakeNames(); cDirectNames=2; HttpPort="8080"; cNodes=1; function MakeProxies(){ this[0]=new Node("hgws01.hesleyinfo.net",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 if(shExpMatch(host, DirectNames)){ fIp = true; break;} if(shExpMatch(url, DirectNames)) 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 if(isInNet(ip, DirectIPs, DirectIPs[i+1])) return "DIRECT";}} else if(isPlainHostName(host)) return "DIRECT"; } if(cCARPExceptions > 0){ for(i = 0; i < cCARPExceptions; i++){ if(shExpMatch(host, CARPExceptions)){ nocarp = true;} if(shExpMatch(url, CARPExceptions)){ nocarp = true; skiphost = true; break; }}} if(!skiphost) hash = HashString(host,hash); if(nocarp) hash = HashString(myIpAddress(), hash); pl = new Array(); for(i = 0; i Proxies.score = Proxies.load * Scramble(hash ^ Proxies.hash); pl = i; } for(j = 0; j < cNodes; j++){ bestscore = -1; for(i = 0; i < cNodes-j; i++){ score = Proxies[pl].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 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©{ return Chars.indexOf© + 32; } function MakeInt(x){ x %= 4294967296; if(x < 0) x += 4294967296; return x; }
Duke5A Posted July 24, 2013 Posted July 24, 2013 @sippo: Here, this one is a bit easier to digest. I use this in my district. function FindProxyForURL(url, host) { //Declare proxy strings as variables var studentproxy = "PROXY studentproxy:3128"; // IP not to use proxy if (shExpMatch(url, "http://10.*")) { return "DIRECT"; } if (shExpMatch(url, "http://192.168.*")) { return "DIRECT"; } if (isPlainHostName(host)) { return "DIRECT"; } // URLS not to use proxy server if (shExpMatch(url, "*somesite.edu*")) { return "DIRECT"; } if (shExpMatch(url, "*somesite.edu*")) { return "DIRECT"; } if (shExpMatch(url, "*somesite.edu*")) { return "DIRECT"; } // Apply proxy if machine is on internal network if (isInNet(myIpAddress(), "10.0.0.0", "255.0.0.0")) { return studentproxy; } if (isInNet(myIpAddress(), "10.0.0.0", "/8")) { return studentproxy; } else return "DIRECT"; } 1
sippo Posted July 30, 2013 Author Posted July 30, 2013 Thanks for that. Is there a way of redirecting the home page?
Duke5A Posted July 31, 2013 Posted July 31, 2013 Thanks for that. Is there a way of redirecting the home page? Though WPAD? No, there isn't. That is something you're going to have to do at the proxy. Is this for a guest network setup where you don't admin the devices using it?
sippo Posted August 5, 2013 Author Posted August 5, 2013 Not the guest network no, just a WLAN. Not a biggie, just would be nice.
Guest Posted December 3, 2013 Posted December 3, 2013 @Duke5A can i just ask a question on your WPAD file. i dont write and never dabbled with Java script, on line 6 for student proxy, how do i write my proxy address on there. do i replace the word "studentproxy" with my proxy ip x.x.x.x thanks
hogwam Posted December 3, 2013 Posted December 3, 2013 @Duke5A can i just ask a question on your WPAD file. i dont write and never dabbled with Java script, on line 6 for student proxy, how do i write my proxy address on there. do i replace the word "studentproxy" with my proxy ip x.x.x.x thanks Either replace 'studentproxy' with the IP address of the proxy or the FQDN of the proxy server, with the appropriate port.
hogwam Posted December 3, 2013 Posted December 3, 2013 Thanks for that. Is there a way of redirecting the home page? You can easily set in Group Policy, or run a VBS like below, replacing the address with your desired homepage Set objWshShell = CreateObject("WScript.Shell") strHomePage = "[url]http://intranet[/url]" objWshShell.RegWrite "HKCU\Software\Microsoft\Internet Explorer\Main\Start Page", strHomePage Set objWshShell = Nothing
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now