Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Hi,

 

I am deploying a proxy .pac file. I want laptop users to hit the smootwall when in school and go direct to the internet when at home. Does the following look ok? Is there anything that you think I can add/remove?

 

 

 

Thanks in advance

 

 

 

 

function FindProxyForURL(url, host)

{

var serverip = "smoothwall ip";

if ((host == serverip)

|| localHostOrDomainIs(host, "smoothwall name"))

{

return "DIRECT";

}

 

if (isPlainHostName(host))

return "DIRECT";

 

 

 

 

 

var ip = dnsResolve(host);

 

 

 

 

 

var quads = ip.split(".");

var ipnum = (parseInt(quads[0], 10) * 16777216)

+ (parseInt(quads[1], 10) * 65536)

+ (parseInt(quads[2], 10) * 256) + parseInt(quads[3], 10);

 

 

if ((ipnum >= 178916032) && (ipnum <= 178916063))

return "DIRECT";

 

 

 

 

if (shExpMatch(host, "*website to exclude"))

return "DIRECT";

 

 

 

 

 

 

if (serverip == "server ip") {

 

return "PROXY server ip:3128";

 

}

 

 

return "DIRECT";

}

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