Oracle iPlanet Web Proxy Server 4.0.14 Administration Guide

Example 5: Balance Proxy Load With dnsDomainIs()()

This example is more sophisticated. The example uses four proxy servers, with one of them acting as a hot standby for the others. If any of the remaining three proxy servers goes down, the fourth one takes over. The three remaining proxy servers share the load based on URL patterns, which makes their caching more effective. Only one copy of any document exists on the three servers, as opposed to one copy on each of them. The load is distributed as shown in the following table.

Table 17–3 Balance Proxy Load




.com domain


.edu domain


all other domains 


hot standby 

All local accesses should be direct. All proxy servers run on port 8080. You can concatenate strings by using the + operator.

function FindProxyForURL(url, host)
    if (isPlainhost name(host) || dnsDomainIs(host, ""))
        return "DIRECT";

    else if (dnsDomainIs(host, ".com"))
        return "PROXY; " +

    else if (dnsDomainIs(host, ".edu"))
        return "PROXY; " +

        return "PROXY; " +