Sun Java System Web Proxy Server 4.0.8 管理指南

示例 1:代理除本地主机之外的所有服务器

在本例中,浏览器直接连接到非全限定的所有主机以及本地域中的主机。所有其他主机均要经过名为 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";
    }