summaryrefslogtreecommitdiff
path: root/app/src/main/java/de
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2022-07-12 16:15:58 +0200
committercyBerta <cyberta@riseup.net>2022-07-19 00:03:57 +0200
commit1f12d1b99a88bf62f29798a30135473299978234 (patch)
tree12a7e99870f863b059cf85574550d1b59c2adaf6 /app/src/main/java/de
parent35c3173690032a1c852001107a4cb6ca3f9bcc83 (diff)
implement error handling for socks port binding
Diffstat (limited to 'app/src/main/java/de')
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java3
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/connection/Obfs4Connection.java2
2 files changed, 3 insertions, 2 deletions
diff --git a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
index 987708f4..94922ed5 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/OpenVPNService.java
@@ -423,7 +423,8 @@ public class OpenVPNService extends VpnService implements StateListener, Callbac
obfsVpnClient.stop();
}
obfsVpnClient = new ObfsVpnClient(obfs4Connection.getDispatcherOptions());
- obfsVpnClient.start();
+ int runningSocksPort = obfsVpnClient.start();
+ connection.setProxyPort(String.valueOf(runningSocksPort));
} else if (shapeshifter == null) {
shapeshifter = new Shapeshifter(obfs4Connection.getDispatcherOptions());
shapeshifter.start();
diff --git a/app/src/main/java/de/blinkt/openvpn/core/connection/Obfs4Connection.java b/app/src/main/java/de/blinkt/openvpn/core/connection/Obfs4Connection.java
index d3cfdc83..5189afcc 100644
--- a/app/src/main/java/de/blinkt/openvpn/core/connection/Obfs4Connection.java
+++ b/app/src/main/java/de/blinkt/openvpn/core/connection/Obfs4Connection.java
@@ -22,7 +22,7 @@ public class Obfs4Connection extends Connection {
setServerName(options.remoteIP);
setServerPort(options.remotePort);
setProxyName(ObfsVpnClient.SOCKS_IP);
- setProxyPort(ObfsVpnClient.SOCKS_PORT);
+ setProxyPort(String.valueOf(ObfsVpnClient.SOCKS_PORT.get()));
setProxyType(ProxyType.SOCKS5);
} else {
setServerName(DISPATCHER_IP);