From be08e8f23b0b5664de71e4d8ac1454446833e39b Mon Sep 17 00:00:00 2001
From: jrandom <jrandom>
Date: Sat, 7 Aug 2004 06:28:29 +0000
Subject: [PATCH] use the env defaults when no i2cp info is specified

---
 .../client/streaming/I2PSocketManagerFactory.java   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java
index 2f4f3a7873..2d5a02fd99 100644
--- a/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java
+++ b/apps/ministreaming/java/src/net/i2p/client/streaming/I2PSocketManagerFactory.java
@@ -30,7 +30,18 @@ public class I2PSocketManagerFactory {
      * @return the newly created socket manager, or null if there were errors
      */
     public static I2PSocketManager createManager() {
-        return createManager("localhost", 7654, new Properties());
+        String i2cpHost = System.getProperty(I2PClient.PROP_TCP_HOST, "localhost");
+        int i2cpPort = 7654;
+        String i2cpPortStr = System.getProperty(I2PClient.PROP_TCP_PORT);
+        if (i2cpPortStr != null) {
+            try {
+                i2cpPort = Integer.parseInt(i2cpPortStr);
+            } catch (NumberFormatException nfe) {
+                // gobble gobble
+            }
+        }
+
+        return createManager(i2cpHost, i2cpPort, System.getProperties());
     }
 
     /**
-- 
GitLab