I'll post it here so everyone can have a look.
There is no need to change anything to have it failover, people may need to close their browser and open it again so it re-reads the pac file, but that is all.
One thing to note below, it's easiest to set variables for your proxy IP's at the start and call them when necessary. We couldn't do that as we have to use an old version Java for particular apps, and it just couldn't handle the variables.
Any questions, just post away.
My anonymized pac file:
function FindProxyForURL(url, host)
{
//If name has no dots, don't use proxy
if (
isPlainHostName(host)
)
return "DIRECT";
//LocalHost Entries
if (
shExpMatch(url, "http://127.0.0.1*") ||
shExpMatch(url, "https://127.0.0.1*") ||
shExpMatch(url, "http://localhost*") ||
shExpMatch(url, "https://localhost*")
)
return "DIRECT";
//Other Direct Access Sites/Servers
if (
shExpMatch(url, "http://*.domain.xxx.xxx.uk*") ||
shExpMatch(url, "
https://www.madeupsite.com/*")
)
return "DIRECT";
//Proxy for Site1 Subnets
if (
isInNet(myIpAddress(), "192.168.139.0", "255.255.255.0") ||
isInNet(myIpAddress(), "10.210.120.0", "255.255.248.0") ||
isInNet(myIpAddress(), "10.210.128.0", "255.255.248.0") ||
isInNet(myIpAddress(), "192.168.100.0", "255.255.255.0") ||
isInNet(myIpAddress(), "192.168.29.0", "255.255.255.128")
)
return "PROXY 10.210.121.147:8080; PROXY 10.210.137.9:8080";
//Proxy for Site2 Subnets
if (
isInNet(myIpAddress(), "10.210.136.0", "255.255.248.0")
)
return "PROXY 10.210.137.9:8080; PROXY 10.210.121.147:8080";
//Last Chance Saloon
else return "DIRECT";
}