autoconfig.pac can be used to browse .yacy-domains only

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@6077 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 16 years ago
parent 4e825852d2
commit aec3e7995a

@ -515,6 +515,9 @@ proxyIndexingRemote=false
proxyIndexingLocalText=true
proxyIndexingLocalMedia=true
# proxy usage only for .yacy-Domains for autoconfig
proxyYacyOnly=false
# From the 'IndexCreate' menu point you can also define a crawling start point.
# The crawling works the same way as the prefetch, but it is possible to
# assign a different crawling depth.

@ -18,6 +18,19 @@
<form action="ProxyIndexingMonitor_p.html" method="post" enctype="multipart/form-data">
<table border="0" cellpadding="5" cellspacing="1">
<tr class="TableCellDark">
<td colspan="3"><strong>Proxy Auto Config:</strong>
this controls the proxy auto configuration script for browsers at http://localhost:8080/autoconfig.pac
</td>
</tr>
<tr valign="top" class="TableCellLight">
<td><label for="proxyYacyOnly">.yacy-domains only</label></td>
<td><input type="checkbox" id="proxyYacyOnly" name="proxyYacyOnly"#(proxyYacyOnly)#:: checked="checked"#(/proxyYacyOnly)# /></td>
<td>
whether the proxy should only be used for .yacy-Domains
</td>
</tr>
<tr class="TableCellDark">
<td colspan="3"><strong>Proxy pre-fetch setting:</strong>
this is an automated html page loading procedure that takes actual proxy-requested

@ -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");

@ -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;
}

@ -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)#
}

@ -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

Loading…
Cancel
Save