publicIP() fix

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@593 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 20 years ago
parent 66ebce1109
commit b778493aae

@ -51,6 +51,8 @@ import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Set;
import java.net.InetAddress;
import java.net.UnknownHostException;
import de.anomic.http.httpHeader;
import de.anomic.plasma.plasmaCondenser;
@ -94,8 +96,12 @@ public class dir {
prop.put("peername", env.getConfig("peerName", "<nameless>"));
prop.put("peerdomain", env.getConfig("peerName", "<nameless>").toLowerCase());
prop.put("peeraddress", yacyCore.seedDB.mySeed.getAddress());
prop.put("hostname", serverCore.publicIP().getHostName());
prop.put("hostip", serverCore.publicIP().getHostAddress());
prop.put("hostname", serverCore.publicIP());
try{
prop.put("hostip", InetAddress.getByName(serverCore.publicIP()).getHostAddress());
}catch(UnknownHostException e){
prop.put("hostip", "Unknown Host Exception");
}
prop.put("port", env.getConfig("port", "8080"));
// generate upload/download authorizations

@ -43,6 +43,9 @@
// javac -classpath .:../Classes index.java
// if the shell's current path is HTROOT
import java.net.InetAddress;
import java.net.UnknownHostException;
import de.anomic.http.httpHeader;
import de.anomic.server.serverCore;
import de.anomic.server.serverObjects;
@ -65,8 +68,12 @@ public class welcome {
prop.put("peername", env.getConfig("peerName", "<nameless>"));
prop.put("peerdomain", env.getConfig("peerName", "<nameless>").toLowerCase());
prop.put("peeraddress", yacyCore.seedDB.mySeed.getAddress());
prop.put("hostname", serverCore.publicIP().getHostName());
prop.put("hostip", serverCore.publicIP().getHostAddress());
prop.put("hostname", serverCore.publicIP());
try{
prop.put("hostip", InetAddress.getByName(serverCore.publicIP()).getHostAddress());
}catch(UnknownHostException e){
prop.put("hostip", "Unknown Host Exception");
}
prop.put("port", env.getConfig("port", "8080"));
prop.put("clientip", header.get("CLIENTIP", ""));

Loading…
Cancel
Save