From a566588e9bdcc02197d9d2de0fc81411a4698f03 Mon Sep 17 00:00:00 2001 From: theli Date: Thu, 9 Jun 2005 09:44:07 +0000 Subject: [PATCH] *) adding configuration section for new http keep-alive support *) moving transparent proxy configuration into new config section git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@238 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/SettingsAck_p.html | 18 ++++++++++++++---- htroot/SettingsAck_p.java | 29 +++++++++++++++++++++-------- htroot/Settings_p.html | 38 ++++++++++++++++++++++++++------------ htroot/Settings_p.java | 8 ++++++-- 4 files changed, 67 insertions(+), 26 deletions(-) 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 :: Your proxy access setting has been changed.
Your proxy account check has been disabled, since you did not supply a password.

-The new proxy IP filter is set to #[filter]#
-Transparent Proxy Support is: #[isTransparentProxy]#

+The new proxy IP filter is set to #[filter]#

The proxy port is: #[port]#
if you changed the Port, you need to restart YaCy. :: Your proxy access setting has been changed.
Your new proxy account name is #[user]#. The password has been accepted.
If you open any public web page through the proxy, you must log-in then.
-The new proxy IP filter is set to #[filter]#.
-Transparent Proxy Support is: #[isTransparentProxy]#

+The new proxy IP filter is set to #[filter]#.

The proxy port is: #[port]#
if you changed the Port, you need to restart YaCy. :: @@ -88,6 +86,18 @@ Seed Upload method was changed successfully. Seed Upload Method:#[seedUploadMethod]# Seed File URL:#[seedURL]# +:: +

Your proxy networking settings have been changed.

+ + + + + + + + + +
Transparent Proxy Support is:#[isTransparentProxy]#
Connection Keep-Alive Support is:#[connectionKeepAliveSupport]#
#(/info)#

You can now go back to the Settings page if you want to make more changes.

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 --> - - - + @@ -68,15 +66,7 @@ delete the file 'DATA/SETTINGS/httpProxy.conf' in the YaCy application root fold Proxy and Administration Port: Changes will take effect after restart only. - - - Transparent Proxy: - - With this you can specify if YaCy can be used as transparent proxy.
- Hint: On Linux you can configure your firewall to transparently redirect all HTTP traffic through YaCy using this iptables rule:
- iptables -t nat -A PREROUTING -p tcp -s 192.168.0.0/16 --dport 80 -j DNAT --to 192.168.0.1:#[port]# - - +

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
+

+
HTTP Networking + + + + + + + + + + + + + + + +
Transparent Proxy:With this you can specify if YaCy can be used as transparent proxy.
+ Hint: On linux you can configure your firewall to transparently redirect all http traffic through yacy using this iptables rule:
+ iptables -t nat -A PREROUTING -p tcp -s 192.168.0.0/16 --dport 80 -j DNAT --to 192.168.0.1:#[port]# +
Connection Keep-Alive:With this you can specify if YaCy should support the HTTP connection keep-alive feature.
 Changes will take effect immediately.
+
+

+

Remote Proxy (optional)

YaCy can use another proxy to connect to the internet. You can enter the address for the remote proxy here:

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;