better proxy configuration in case of remote proxy

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6016 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
lotus 2009-06-03 19:03:03 +00:00
parent cc49aedf12
commit efe97f446a

View File

@ -4,6 +4,9 @@ function FindProxyForURL(url,host) {
return "DIRECT"; return "DIRECT";
} }
// not the proxy itself
if (host == "#[host]#") return "DIRECT";
// no local adresses // no local adresses
ip = dnsResolve(host); ip = dnsResolve(host);
if ( isInNet(ip, "127.0.0.0", "255.0.0.0") if ( isInNet(ip, "127.0.0.0", "255.0.0.0")
@ -13,6 +16,9 @@ function FindProxyForURL(url,host) {
return "DIRECT"; return "DIRECT";
} }
// not the proxy itself (better: dnsResolve(#[host]#), but an additional lookup)
if (ip == "#[host]#") return "DIRECT";
// then // then
return "PROXY #[host]#:#[port]#, DIRECT"; return "PROXY #[host]#:#[port]#, DIRECT";
} }