we use an autoconfiguration script (pac file). It's a browser setting in most browsers. it can load from your webserver.
It detects if the client has a school ip range (ours is 172.16 range) then proxies those but not others
Code:
function FindProxyForURL(url, host)
{
// Variable strings to return
var proxy_yes = "PROXY 172.16.0.197:8000";
var proxy_no = "DIRECT";
// Execptions for direct connection
if (shExpMatch(url, "http://internal.site.sch.uk*")) { return proxy_no; }
// Proxy if PC is on local LAN
if (isInNet(myIpAddress(), "172.16.0.0", "255.255.0.0"))
return "PROXY 172.16.0.197:8000";
// Below for Firefox bug when running on Linux by checking localhost
else if (isInNet(myIpAddress(), "127.0.0.0", "255.0.0.0"))
return "PROXY 172.16.0.197:8000";
// Everything else to go direct
else
return "DIRECT";
}