aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-09-27 11:44:50 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-09-27 11:44:50 +0200
commitbb48f67a30d09623a896dd125627666ff4e171f8 (patch)
tree97773f78b8e1abfe6ef8a912fc66a7d8fdaec746 /src
parent1339b9c4644d784ab3f662ad2aa2988879ee92cf (diff)
always use ipv4 localhost for Orbot connections
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/SocksSocketFactory.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/SocksSocketFactory.java b/src/main/java/eu/siacs/conversations/utils/SocksSocketFactory.java
index 768e9f17..81f93653 100644
--- a/src/main/java/eu/siacs/conversations/utils/SocksSocketFactory.java
+++ b/src/main/java/eu/siacs/conversations/utils/SocksSocketFactory.java
@@ -12,6 +12,8 @@ import eu.siacs.conversations.Config;
public class SocksSocketFactory {
+ private static final byte[] LOCALHOST = new byte[]{127,0,0,1};
+
public static void createSocksConnection(Socket socket, String destination, int port) throws IOException {
InputStream proxyIs = socket.getInputStream();
OutputStream proxyOs = socket.getOutputStream();
@@ -44,7 +46,7 @@ public class SocksSocketFactory {
}
public static Socket createSocketOverTor(String destination, int port) throws IOException {
- return createSocket(new InetSocketAddress(InetAddress.getLocalHost(), 9050), destination, port);
+ return createSocket(new InetSocketAddress(InetAddress.getByAddress(LOCALHOST), 9050), destination, port);
}
static class SocksConnectionException extends IOException {