Jump to content

Recommended Posts

Posted

Hello All

 

Could you give me a hand? I've looked around on ye'olde internet but can't find anything that will help me understand how to make one of these.

 

Basically I'd like to setup a .pac file for automatic proxy config and want it pointing to our smoothwall box but also have a couple of exceptions. Does anyone have any advice or a template I can use?

 

Thanks :)

Posted
You could just create a WPAD and use DHCP to issue it out.

 

Yes that would work as well! Would you happen to have a template on how I can achieve the above with a wpad file?

Posted (edited)

This is what I had in the pac for students on their VLAN.

 

function FindProxyForURL(url,host){ return "PROXY 172.20.20.251:8083"; }

 

save that in notepad named wpad.dat. It needs to be placed somewhere that has read access for everyone. I used IIS on one of my DCs. Then just you need to access DHCP, scope you want the WPAD accessed on, scope options and then use rule 252 WPAD. You'll also need to create a dns record called WPAD linking to the IP address of the server you have placed it on.

 

Hope this helps.

Edited by DavetheITguy
Posted
This is what I had in the pac for students on their VLAN.

 

function FindProxyForURL(url,host){ return "PROXY 172.20.20.251:8083"; }

 

save that in notepad named wpad.dat. It needs to be placed somewhere that has read access for everyone. I used IIS on one of my DCs. Then just you need to access DHCP, scope you want the WPAD accessed on, scope options and then use rule 252 WPAD. You'll also need to create a dns record called WPAD linking to the IP address of the server you have placed it on.

 

Hope this helps.

Brill thanks for that do you know of a way how to add exceptions into that? Is that the whole code!

Posted
I found you had to save two copies of it, proxy.pac and wpad.dat as some browsers (usually everything except IE, although chrome seems to just use the IE settings) look for proxy.pac - not sure if this is still the case now in 2016 though. It then needs to be accessible at http://wpad.your.AD.domain/wpad.dat (and http://wpad.your.AD.domain/proxy.pac) and there is also a DHCP option you can set that DavetheITguy mentioned earlier.
Posted

Here's one of mine with a few exceptions:

 

function FindProxyForURL(url, host)
{
//Declare Date variable
   var dTime = new Date();
//Declare and resolve Time variables
   var hours = dTime.getHours();
   var minutes = dTime.getMinutes();
//Set proxy to Direct over lunch
   if (hours == 12 && minutes > 10)
   return "DIRECT";
   if (hours == 13 && minutes < 08)
   return "DIRECT";
//Block access to all those nasty *.io Flash game sites that the firewall doesn't seem to spot
   if (shExpMatch(url, "*.io*"))
   return "DIRECT";
// Otherwise use proxy
   else 
   {return "PROXY address.to.proxy:PORT";    }
}

Posted

Here's one of mine with a few exceptions:

 

function FindProxyForURL(url, host)
{
//Declare Date variable
   var dTime = new Date();
//Declare and resolve Time variables
   var hours = dTime.getHours();
   var minutes = dTime.getMinutes();
//Set proxy to Direct over lunch
   if (hours == 12 && minutes > 10)
   return "DIRECT";
   if (hours == 13 && minutes < 08)
   return "DIRECT";
//Block access to all those nasty *.io Flash game sites that the firewall doesn't seem to spot
   if (shExpMatch(url, "*.io*"))
   return "DIRECT";
// Otherwise use proxy
   else 
   {return "PROXY address.to.proxy:PORT";    }
}

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