PDA

View Full Version : how to code this?



Voltimolt
October 28th, 2010, 07:24
I downloaded a copy of a proxy script of my school, I was kind of recoding it to unblock websites


function FindProxyForURL (url, host)
{
// AIBE PAC File Template
// Version 2.3 created 11/12/2006

// Go Direct for NetBios and localhosts
if (isPlainHostName(host) ||
localHostOrDomainIs(host, "localhost") ||
localHostOrDomainIs(host, "127.0.0.1"))
return "DIRECT";

// Go Direct for local School, TAFE and CPC services
if (dnsDomainIs (host, ".win") ||
dnsDomainIs (host, ".tafensw.edu.au") ||
dnsDomainIs (host, ".schools.nsw.edu.au") ||
dnsDomainIs (host, ".dlr.det.nsw.edu.au") ||
dnsDomainIs (host, ".dtmanagement.det.nsw.edu.au") ||
dnsDomainIs (host, ".cli.det.nsw.edu.au") ||
shExpMatch (url, "*://10.*") ||
shExpMatch (url, "*://172.16.*") ||
shExpMatch (url, "*://172.17.*") ||
shExpMatch (url, "*://172.18.*") ||
shExpMatch (url, "*://172.19.*") ||
shExpMatch (url, "*://172.2?.*") ||
shExpMatch (url, "*://172.30.*") ||
shExpMatch (url, "*://172.31.*") ||
shExpMatch (url, "*://153.107.*"))
return "DIRECT";

// Send all other request at Proxy
return "PROXY 221.130.23.157:80";
}


This is a .pac extention.

i also changed

// Send all other request at Proxy
return "PROXY 221.130.23.157:80";


to a custom proxy server in china.