You could prolly muck around with redirecting ports but sane browsers support either the automatic proxy URI where you serve a proxy.pac or can use a local proxy.pac file. Here's an example:
Code:
function FindProxyForURL(url, host)
{
// Direct connections to non-FQDN hosts
if (isPlainHostName(host))
return "DIRECT";
// Direct connections to local domain
else if (dnsDomainIs(host, ".localnet"))
return "DIRECT";
else if (shExpMatch(url, "https://*"))
return "DIRECT";
else if (shExpMatch(host, "www.[a-h]*") || shExpMatch(host, "[a-h]*"))
return "PROXY localnet:8080; " +
"PROXY localnet:8080; " +
"DIRECT";
else if (shExpMatch(host, "www.[i-z]*") || shExpMatch(host, "[i-z]*"))
return "PROXY localnet:8081; " +
"PROXY localnet:8081; " +
"DIRECT";
else
return "PROXY localnet:8082; " +
"PROXY localnet:8082; " +
"DIRECT";
}