在本例中,浏览器直接连接到非全限定的所有主机以及本地域中的主机。所有其他主机均要经过名为 w3proxy.example.com:8080 的代理。
如果此代理出现故障,则自动进行直接连接。
function FindProxyForURL(url, host) { if (isPlainhost name(host) || dnsDomainIs(host, ".example.com") || dnsDomainIs(host, ".mcom.com")) return "DIRECT"; else return "PROXY w3proxy.example.com:8080; DIRECT"; }