From 1ecb3befed4f726f9334947306773c20c3cd9afa Mon Sep 17 00:00:00 2001 From: Christian S Date: Thu, 21 Apr 2016 21:25:34 +0200 Subject: use IP/port to connect to server --- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/main/java/eu/siacs/conversations/xmpp') diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 4dc5492e3..afae7b3a7 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -254,7 +254,17 @@ public class XmppConnection implements Runnable { this.changeStatus(Account.State.CONNECTING); final boolean useTor = mXmppConnectionService.useTorToConnect() || account.isOnion(); final boolean extended = mXmppConnectionService.showExtendedConnectionOptions(); - if (useTor) { + if (Config.XMPP_IP != null && Config.XMPP_Port != null) { + socket = new Socket(); + try { + socket.connect(new InetSocketAddress(Config.XMPP_IP, Config.XMPP_Port), Config.SOCKET_TIMEOUT * 1000); + } catch (IOException e) { + throw new UnknownHostException(); + } + Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": connect to " + Config.XMPP_IP + ":" + Config.XMPP_Port); + startXmpp(); + } + else if (useTor) { String destination; if (account.getHostname() == null || account.getHostname().isEmpty()) { destination = account.getServer().toString(); -- cgit v1.2.3