summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2023-04-13 13:44:47 +0200
committercyBerta <cyberta@riseup.net>2023-04-13 16:47:13 +0200
commit2f32f3331b609d8a0324726f173e1aacf8854808 (patch)
tree17f9be0c5b8ce95d320f26ca296d8348c440f6c2
parent6dd7821cd38c69b9fdc3172762744f32dcbf9606 (diff)
set correct proxy port for obfs4-hop pt proxy
-rw-r--r--app/src/main/java/de/blinkt/openvpn/core/connection/Obfs4Connection.java20
1 files changed, 16 insertions, 4 deletions
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 73bfccdc..d152031a 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
@@ -4,6 +4,7 @@ import static se.leap.bitmaskclient.base.utils.ConfigHelper.ObfsVpnHelper.useObf
import static se.leap.bitmaskclient.pluggableTransports.ShapeshifterClient.DISPATCHER_IP;
import static se.leap.bitmaskclient.pluggableTransports.ShapeshifterClient.DISPATCHER_PORT;
+import se.leap.bitmaskclient.pluggableTransports.HoppingObfsVpnClient;
import se.leap.bitmaskclient.pluggableTransports.Obfs4Options;
import se.leap.bitmaskclient.pluggableTransports.ObfsVpnClient;
@@ -22,18 +23,29 @@ public class Obfs4Connection extends Connection {
setServerName(options.gatewayIP);
setServerPort(options.transport.getPorts()[0]);
setProxyName(ObfsVpnClient.SOCKS_IP);
- setProxyPort(String.valueOf(ObfsVpnClient.SOCKS_PORT.get()));
setProxyType(ProxyType.SOCKS5);
+ switch (options.transport.getTransportType()) {
+ case OBFS4:
+ setUseUdp(false);
+ setProxyPort(String.valueOf(ObfsVpnClient.SOCKS_PORT.get()));
+ break;
+ case OBFS4_HOP:
+ setUseUdp(true);
+ setProxyPort(String.valueOf(HoppingObfsVpnClient.PORT));
+ break;
+ default:break;
+ }
} else {
setServerName(DISPATCHER_IP);
setServerPort(DISPATCHER_PORT);
setProxyName("");
setProxyPort("");
setProxyType(ProxyType.NONE);
+
+ // while udp/kcp might be used on the wire,
+ // we don't use udp for openvpn in case of a obfs4 connection
+ setUseUdp(false);
}
- // while udp/kcp might be used on the wire,
- // we don't use udp for openvpn in case of a obfs4 connection
- setUseUdp(false);
setProxyAuthUser(null);
setProxyAuthPassword(null);
setUseProxyAuth(false);