Proxy pre-fetch setting:
this is an automated html page loading procedure that takes actual proxy-requested
diff --git a/htroot/ProxyIndexingMonitor_p.java b/htroot/ProxyIndexingMonitor_p.java
index e7f7917c4..cba9b4bb4 100644
--- a/htroot/ProxyIndexingMonitor_p.java
+++ b/htroot/ProxyIndexingMonitor_p.java
@@ -63,6 +63,8 @@ public class ProxyIndexingMonitor_p {
if (post.containsKey("proxyprofileset")) try {
// read values and put them in global settings
+ final boolean proxyYaCyOnly = post.containsKey("proxyYacyOnly");
+ env.setConfig(plasmaSwitchboardConstants.PROXY_YACY_ONLY, (proxyYaCyOnly) ? "true" : "false");
int newProxyPrefetchDepth = post.getInt("proxyPrefetchDepth", 0);
if (newProxyPrefetchDepth < 0) newProxyPrefetchDepth = 0;
if (newProxyPrefetchDepth > 20) newProxyPrefetchDepth = 20; // self protection ?
@@ -147,6 +149,8 @@ public class ProxyIndexingMonitor_p {
}
}
+ final boolean yacyonly = env.getConfigBool(plasmaSwitchboardConstants.PROXY_YACY_ONLY, false);
+ prop.put("proxyYacyOnly", yacyonly ? "1" : "0");
prop.put("proxyPrefetchDepth", env.getConfigLong("proxyPrefetchDepth", 0));
prop.put("proxyStoreHTCacheChecked", env.getConfig("proxyStoreHTCache", "").equals("true") ? "1" : "0");
prop.put("proxyIndexingRemote", env.getConfig("proxyIndexingRemote", "").equals("true") ? "1" : "0");
diff --git a/htroot/autoconfig.java b/htroot/autoconfig.java
index bfdf7a7e1..7d61e86d9 100644
--- a/htroot/autoconfig.java
+++ b/htroot/autoconfig.java
@@ -25,6 +25,7 @@
//if the shell's current path is HTROOT
import de.anomic.http.httpRequestHeader;
+import de.anomic.plasma.plasmaSwitchboardConstants;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
@@ -43,6 +44,8 @@ public class autoconfig {
final serverObjects prop = new serverObjects();
+ final boolean yacyonly = env.getConfigBool(plasmaSwitchboardConstants.PROXY_YACY_ONLY, false);
+
// getting the http host header
final String hostSocket = header.get(httpRequestHeader.CONNECTION_PROP_HOST);
@@ -54,8 +57,9 @@ public class autoconfig {
host = hostSocket.substring(0, pos);
}
- prop.put("host", host);
- prop.put("port", port);
+ prop.put("yacy", yacyonly ? "0" : "1");
+ prop.put("yacy_host", host);
+ prop.put("yacy_port", port);
return prop;
}
diff --git a/htroot/autoconfig.pac b/htroot/autoconfig.pac
index 435e4587c..efb3860a1 100644
--- a/htroot/autoconfig.pac
+++ b/htroot/autoconfig.pac
@@ -1,4 +1,11 @@
function FindProxyForURL(url,host) {
+#(yacy)#
+ // .yacy only
+ if(shExpMatch(host,"*.yacy")) {
+ return "PROXY #[host]#:#[port]#, DIRECT";
+ }
+ return "DIRECT";
+::
// http only
if (!(url.substring(0, 5).toLowerCase() == "http:")) {
return "DIRECT";
@@ -21,4 +28,5 @@ function FindProxyForURL(url,host) {
// then
return "PROXY #[host]#:#[port]#, DIRECT";
+#(/yacy)#
}
\ No newline at end of file
diff --git a/source/de/anomic/plasma/plasmaSwitchboardConstants.java b/source/de/anomic/plasma/plasmaSwitchboardConstants.java
index 35849e561..d983fd360 100644
--- a/source/de/anomic/plasma/plasmaSwitchboardConstants.java
+++ b/source/de/anomic/plasma/plasmaSwitchboardConstants.java
@@ -277,6 +277,7 @@ public final class plasmaSwitchboardConstants {
* @see plasmaSwitchboard#PROXY_CACHE_LAYOUT_TREE
* @see plasmaSwitchboard#PROXY_CACHE_LAYOUT_HASH
*/
+ public static final String PROXY_YACY_ONLY = "proxyYacyOnly";
//////////////////////////////////////////////////////////////////////////////////////////////
// Cluster settings
|