Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

*) adding configuration section for new http keep-alive support *) moving transparent proxy configuration into new config section

thelia566588e9bdc
diff --git a/htroot/SettingsAck_p.html b/htroot/SettingsAck_p.html
index ea463b187..3bdcbe002 100644
--- a/htroot/SettingsAck_p.html
+++ b/htroot/SettingsAck_p.html
@@ -30,16 +30,14 @@ Your new administration account name is #[user]#. The password has been accepted
::
<b>Your proxy access setting has been changed.<br>
Your proxy account check has been disabled, since you did not supply a password.</b><br>
-The new proxy IP filter is set to #[filter]#<br>
-Transparent Proxy Support is: <font color="#556699">#[isTransparentProxy]#</font><p>
+The new proxy IP filter is set to #[filter]#<p>
The proxy port is: <font color="#556699">#[port]#</font><br>
<u>if you changed the Port, you need to restart YaCy.</u>
::
<b>Your proxy access setting has been changed.</b><br>
Your new proxy account name is #[user]#. The password has been accepted.<br>
If you open any public web page through the proxy, you must log-in then.<br>
-The new proxy IP filter is set to #[filter]#.<br>
-Transparent Proxy Support is: <font color="#556699">#[isTransparentProxy]#</font><p>
+The new proxy IP filter is set to #[filter]#.<p>
The proxy port is: <font color="#556699">#[port]#</font><br>
<u>if you changed the Port, you need to restart YaCy.</u>
::
@@ -88,6 +86,18 @@ Seed Upload method was changed successfully.
<tr><td>Seed Upload Method:</td><td><font color="#556699">#[seedUploadMethod]#</font></td></tr>
<tr><td>Seed File URL:</td><td><a href="#[seedURL]#"><font color="#556699">#[seedURL]#</font></a></td></tr>
</table>
+::
+<p><b>Your proxy networking settings have been changed.</b></p>
+<table>
+<tr>
+ <td>Transparent Proxy Support is:</td>
+ <td><font color="#556699"><b>#[isTransparentProxy]#</b></font></td>
+</tr>
+<tr>
+ <td>Connection Keep-Alive Support is:</td>
+ <td><font color="#556699"><b>#[connectionKeepAliveSupport]#</b></font></td>
+ </tr>
+ </table>
#(/info)#
</p>
<p>You can now go back to the <a href="Settings_p.html">Settings</a> page if you want to make more changes.</p>
diff --git a/htroot/SettingsAck_p.java b/htroot/SettingsAck_p.java
index 7045052f5..29969cd86 100644
--- a/htroot/SettingsAck_p.java
+++ b/htroot/SettingsAck_p.java
@@ -54,6 +54,7 @@ import java.util.Iterator;
import java.util.List;
import de.anomic.http.httpHeader;
+import de.anomic.http.httpd;
import de.anomic.http.httpdProxyHandler;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverCodings;
@@ -125,15 +126,10 @@ public class SettingsAck_p {
// proxy password
if (post.containsKey("proxyaccount")) {
- // set new port
+ // set new port
String port = (String) post.get("port");
- env.setConfig("port", port);
- prop.put("info_port", port);
-
- // set transparent proxy flag
- httpdProxyHandler.isTransparentProxy = post.containsKey("isTransparentProxy");
- env.setConfig("isTransparentProxy", httpdProxyHandler.isTransparentProxy ? "true" : "false");
- prop.put("info_isTransparentProxy", httpdProxyHandler.isTransparentProxy ? "on" : "off");
+ env.setConfig("port", port);
+ prop.put("info_port", port);
// read and process data
String filter = (String) post.get("proxyfilter");
@@ -173,6 +169,23 @@ public class SettingsAck_p {
return prop;
}
+ // http networking
+ if (post.containsKey("httpNetworking")) {
+
+ // set transparent proxy flag
+ httpdProxyHandler.isTransparentProxy = post.containsKey("isTransparentProxy");
+ env.setConfig("isTransparentProxy", httpdProxyHandler.isTransparentProxy ? "true" : "false");
+ prop.put("info_isTransparentProxy", httpdProxyHandler.isTransparentProxy ? "on" : "off");
+
+ // setting the keep alive property
+ httpd.keepAliveSupport = post.containsKey("connectionKeepAliveSupport");
+ env.setConfig("connectionKeepAliveSupport", httpd.keepAliveSupport ? "true" : "false");
+ prop.put("info_connectionKeepAliveSupport", httpd.keepAliveSupport ? "on" : "off");
+
+ prop.put("info", 20);
+ return prop;
+ }
+
// server password
if (post.containsKey("serveraccount")) {
// read and process data
diff --git a/htroot/Settings_p.html b/htroot/Settings_p.html
index 889bc717c..3d58b0854 100644
--- a/htroot/Settings_p.html
+++ b/htroot/Settings_p.html
@@ -53,9 +53,7 @@ delete the file 'DATA/SETTINGS/httpProxy.conf' in the YaCy application root fold
</tr>
-->
<tr>
- <td><input type="submit" name="generalsettings" value="submit"></td>
- <td></td>
- <td></td>
+ <td colspan="3"><input type="submit" name="generalsettings" value="submit"></td>
</tr>
</table>
</fieldset>
@@ -68,15 +66,7 @@ delete the file 'DATA/SETTINGS/httpProxy.conf' in the YaCy application root fold
<td>Proxy and Administration Port:</td>
<td><input name="port" type="text" size="5" maxlength="5" value="#[port]#"></td>
<td><i>Changes will take effect after restart only.</i></td>
- </tr>
- <tr valign="top">
- <td>Transparent Proxy:</td>
- <td><input type="checkbox" name="isTransparentProxy" align="top" #(isTransparentProxy)#::checked#(/isTransparentProxy)#></td>
- <td>With this you can specify if YaCy can be used as transparent proxy.<br>
- <i>Hint: On Linux you can configure your firewall to transparently redirect all HTTP traffic through YaCy using this iptables rule:</i><br>
- <small><code>iptables -t nat -A PREROUTING -p tcp -s 192.168.0.0/16 --dport 80 -j DNAT --to 192.168.0.1:#[port]#</code></small>
- </td>
- </tr>
+ </tr>
</table>
<p>You can restrict the access to this proxy using a two-stage security barrier:
@@ -96,6 +86,30 @@ delete the file 'DATA/SETTINGS/httpProxy.conf' in the YaCy application root fold
</fieldset>
</form><br>
+<p><form action="SettingsAck_p.html" method="post" enctype="multipart/form-data">
+<fieldset><legend>HTTP Networking</legend>
+<table border="0" cellspacing="5">
+ <tr valign="top">
+ <td>Transparent&nbsp;Proxy:</td>
+ <td><input type="checkbox" name="isTransparentProxy" align="top" #(isTransparentProxy)#::checked#(/isTransparentProxy)#></td>
+ <td>With this you can specify if YaCy can be used as transparent proxy.<br>
+ <i>Hint: On linux you can configure your firewall to transparently redirect all http traffic through yacy using this iptables rule:</i><br>
+ <small><code>iptables -t nat -A PREROUTING -p tcp -s 192.168.0.0/16 --dport 80 -j DNAT --to 192.168.0.1:#[port]#</code></small>
+ </td>
+ </tr>
+ <tr valign="top">
+ <td>Connection&nbsp;Keep-Alive:</td>
+ <td><input type="checkbox" name="connectionKeepAliveSupport" align="top" #(connectionKeepAliveSupport)#::checked#(/connectionKeepAliveSupport)#></td>
+ <td>With this you can specify if YaCy should support the HTTP connection keep-alive feature.</td>
+ </tr>
+ <tr valign="top">
+ <td></td>
+ <td colspan="2"><input type="submit" name="httpNetworking" value="submit">&nbsp;<i>Changes will take effect immediately.</i></td>
+ </tr>
+</table>
+</fieldset>
+</form><br>
+
<p><form action="SettingsAck_p.html" method="post" enctype="multipart/form-data">
<fieldset><legend>Remote Proxy (optional)</legend>
<p>YaCy can use another proxy to connect to the internet. You can enter the address for the remote proxy here:</p>
diff --git a/htroot/Settings_p.java b/htroot/Settings_p.java
index 06c64e8ad..c7357e50d 100644
--- a/htroot/Settings_p.java
+++ b/htroot/Settings_p.java
@@ -65,13 +65,17 @@ public final class Settings_p {
//if (post == null) System.out.println("POST: NULL"); else System.out.println("POST: " + post.toString());
- prop.put("port", env.getConfig("port", "8080"));
- prop.put("isTransparentProxy", env.getConfig("isTransparentProxy", "false").equals("true") ? 1 : 0);
+ prop.put("port", env.getConfig("port", "8080"));
+
prop.put("peerName", env.getConfig("peerName", "nameless"));
String peerLang = env.getConfig("htLocaleSelection", "default");
if (peerLang.equals("default")) peerLang = "en";
prop.put("peerLang", peerLang);
+ // http networking settings
+ prop.put("isTransparentProxy", env.getConfig("isTransparentProxy", "false").equals("true") ? 1 : 0);
+ prop.put("connectionKeepAliveSupport", env.getConfig("connectionKeepAliveSupport", "false").equals("true") ? 1 : 0);
+
// set values
String s;
int pos;