diff --git a/htroot/Settings_PortForwarding.inc b/htroot/Settings_PortForwarding.inc
index a057b4cc6..5e650d1cc 100644
--- a/htroot/Settings_PortForwarding.inc
+++ b/htroot/Settings_PortForwarding.inc
@@ -3,10 +3,11 @@
You can use a remote server running a ssh demon to forward your server/proxy port.
This is useful if you want to tunnel throug a NAT/router.
Alternatively, you can simply set a virtual server port on your NAT/Server to enable connections from outside.
+You need to install libx to use this feature
diff --git a/htroot/Settings_p.java b/htroot/Settings_p.java
index 24f10ccca..d0c5b7a3e 100644
--- a/htroot/Settings_p.java
+++ b/htroot/Settings_p.java
@@ -119,6 +119,14 @@ public final class Settings_p {
prop.put("proxy.sendViaHeader", env.getConfig("proxy.sendViaHeader", "false").equals("true") ? 1 : 0);
// remote port forwarding settings
+ boolean portForwardingAvailable = false;
+ try {
+ Class.forName("de.anomic.server.serverPortForwardingSch");
+ portForwardingAvailable = true;
+ } catch (Exception e) {
+ } catch (Error e) {}
+
+ prop.put("portForwardingAvailable",portForwardingAvailable? 1:0);
prop.put("portForwardingEnabled",env.getConfig("portForwardingEnabled","false").equals("true")? 1 : 0);
prop.put("portForwardingUseProxy",env.getConfig("portForwardingUseProxy", "false").equals("true")? 1 : 0);
prop.put("portForwardingPort",env.getConfig("portForwardingPort", ""));
diff --git a/source/de/anomic/server/serverCore.java b/source/de/anomic/server/serverCore.java
index a3bf4f688..af3d6bc77 100644
--- a/source/de/anomic/server/serverCore.java
+++ b/source/de/anomic/server/serverCore.java
@@ -353,6 +353,11 @@ public final class serverCore extends serverAbstractThread implements serverThre
this.switchboard.setConfig("portForwardingEnabled", "false");
throw e;
}
+ } else {
+ serverCore.portForwardingEnabled = false;
+ serverCore.portForwarding = null;
+ yacyCore.seedDB.mySeed.put(yacySeed.IP,publicIP());
+ yacyCore.seedDB.mySeed.put(yacySeed.PORT,Integer.toString(serverCore.getPortNr(this.switchboard.getConfig("port", "8080"))));
}
}