diff options
author | Christian S <christian@pix-art.de> | 2016-04-21 21:25:34 +0200 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2016-04-21 21:25:34 +0200 |
commit | 1ecb3befed4f726f9334947306773c20c3cd9afa (patch) | |
tree | 0a2a9586d5f3658a585825c5d8a561b9568549d0 /src/main/java/eu/siacs/conversations/xmpp | |
parent | a277d7edd596945e056f7366fdf0f13019fb60e8 (diff) |
use IP/port to connect to server
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java | 12 |
1 files changed, 11 insertions, 1 deletions
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(); |