BOB: Pass through I2CP host/port (ticket #827)

This commit is contained in:
str4d
2014-01-11 04:30:59 +00:00
parent 4308ce6347
commit 1fb2672b67
2 changed files with 15 additions and 1 deletions

View File

@@ -22,6 +22,7 @@ import java.net.ServerSocket;
import java.util.Properties;
import java.util.concurrent.atomic.AtomicBoolean;
import net.i2p.I2PException;
import net.i2p.client.I2PClient;
import net.i2p.client.streaming.I2PServerSocket;
import net.i2p.client.streaming.I2PSocketManager;
import net.i2p.client.streaming.I2PSocketManagerFactory;
@@ -96,10 +97,20 @@ public class MUXlisten implements Runnable {
this.database.releaseReadLock();
this.info.releaseReadLock();
String i2cpHost = Q.getProperty(I2PClient.PROP_TCP_HOST, "127.0.0.1");
int i2cpPort = 7654;
String i2cpPortStr = Q.getProperty(I2PClient.PROP_TCP_PORT, "7654");
try {
i2cpPort = Integer.parseInt(i2cpPortStr);
} catch (NumberFormatException nfe) {
throw new IllegalArgumentException("Invalid I2CP port specified [" + i2cpPortStr + "]");
}
if (this.come_in) {
this.listener = new ServerSocket(port, backlog, host);
}
socketManager = I2PSocketManagerFactory.createManager(prikey, Q);
socketManager = I2PSocketManagerFactory.createManager(
prikey, i2cpHost, i2cpPort, Q);
} catch (IOException e) {
// Something went bad.
this.database.getWriteLock();

View File

@@ -1,3 +1,6 @@
2014-01-11 str4d
* BOB: Pass through I2CP host/port (ticket #827)
2014-01-10 str4d
* BOB: Implement ClientApp interface (ticket #347)