aboutsummaryrefslogtreecommitdiff
path: root/juick-ws/src/main/java/com/juick/ws
diff options
context:
space:
mode:
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws')
-rw-r--r--juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java b/juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java
index 4e2f6d57..b737b5d9 100644
--- a/juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java
+++ b/juick-ws/src/main/java/com/juick/ws/components/XMPPComponent.java
@@ -10,6 +10,7 @@ import com.juick.xmpp.extensions.Nickname;
import com.juick.xmpp.extensions.XOOB;
import com.juick.ws.s2s.*;
import org.apache.commons.dbcp2.BasicDataSource;
+import org.apache.commons.lang3.math.NumberUtils;
import org.springframework.jdbc.core.JdbcTemplate;
import org.xmlpull.v1.XmlPullParserException;
@@ -179,6 +180,7 @@ public class XMPPComponent implements ServletContextListener, Stream.StreamListe
conf.load(sce.getServletContext().getResourceAsStream("/WEB-INF/juick.conf"));
HOSTNAME = conf.getProperty("hostname");
componentName = conf.getProperty("componentname");
+ int componentPort = NumberUtils.toInt(conf.getProperty("component_port"), 5347);
JID Jid = new JID(conf.getProperty("xmppbot_jid"));
STATSFILE = conf.getProperty("statsfile");
keystore = conf.getProperty("keystore");
@@ -196,7 +198,7 @@ public class XMPPComponent implements ServletContextListener, Stream.StreamListe
executorService.submit(() -> {
Socket routerSocket = null;
try {
- routerSocket = new Socket("localhost", 5347);
+ routerSocket = new Socket("localhost", componentPort);
setRouter(new StreamComponent(new JID("s2s"), routerSocket.getInputStream(), routerSocket.getOutputStream(), conf.getProperty("xmpp_password")));
getRouter().addChildParser(new JuickMessage());
getRouter().addListener((Stream.StreamListener) this);