diff options
| author | lotus <lotus@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2009-06-02 12:18:29 +0000 |
|---|---|---|
| committer | lotus <lotus@6c8d7289-2bf4-0310-a012-ef5d649a1542> | 2009-06-02 12:18:29 +0000 |
| commit | 61d9e131b44cb3973d0a365d015f6292ceb360aa (patch) | |
| tree | 28abb87ad6892522869e733d79d37fe5aeb1b8c9 /htroot/autoconfig.pac | |
| parent | 0d44a6d5035d57135dcc39a7e8040b601cf49d47 (diff) | |
better/new proxy auto config
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6010 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot/autoconfig.pac')
| -rw-r--r-- | htroot/autoconfig.pac | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/htroot/autoconfig.pac b/htroot/autoconfig.pac index adb138b3d..5ed509536 100644 --- a/htroot/autoconfig.pac +++ b/htroot/autoconfig.pac @@ -1,10 +1,18 @@ function FindProxyForURL(url,host) {
- if ((isPlainHostName(host))||
- (host=="127.0.0.1")) {
- return "DIRECT";
- } else if (url.substring(0, 4).toLowerCase() == "ftp:") {
+ // http only
+ if (!(url.substring(0, 5).toLowerCase() == "http:")) {
return "DIRECT";
- } else {
- return "PROXY #[host]#:#[port]#, DIRECT";
- }
+ }
+
+ // no local adresses
+ ip = dnsResolve(host);
+ if ( isInNet(ip, "127.0.0.0", "255.0.0.0")
+ || isInNet(ip, "192.168.0.0", "255.255.0.0")
+ || isInNet(ip, "10.0.0.0", "255.0.0.0")
+ || isInNet(ip, "172.16.0.0", "255.240.0.0") ) {
+ return "DIRECT";
+ }
+
+ // then
+ return "PROXY #[host]#:#[port]#, DIRECT";
}
\ No newline at end of file |
