summaryrefslogtreecommitdiffhomepage
path: root/tunnel/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'tunnel/src/main')
-rw-r--r--tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
index 375de1f2..f2eb86da 100644
--- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
+++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java
@@ -529,21 +529,21 @@ public final class GoBackend implements Backend {
service.setUnderlyingNetworks(null);
Log.i(TAG, "Builder 14");
- // Optional<HttpProxy> proxy = config.getInterface().getHttpProxy();
- // if (proxy.isPresent()) {
- // ProxyInfo pi = proxy.get().getProxyInfo();
- // Uri pacFileUrl = pi.getPacFileUrl();
-
- // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- // if (pacFileUrl != null && pacFileUrl != Uri.EMPTY) {
- // int listenPort = startHttpProxy(pacFileUrl);
- // ProxyInfo localPi = ProxyInfo.buildDirectProxy("localhost", listenPort);
- // builder.setHttpProxy(localPi);
- // } else {
- // builder.setHttpProxy(pi);
- // }
- // }
- // }
+ Optional<HttpProxy> proxy = config.getInterface().getHttpProxy();
+ if (proxy.isPresent()) {
+ ProxyInfo pi = proxy.get().getProxyInfo();
+ Uri pacFileUrl = pi.getPacFileUrl();
+
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
+ if (pacFileUrl != null && pacFileUrl != Uri.EMPTY) {
+ int listenPort = startHttpProxy(pacFileUrl);
+ ProxyInfo localPi = ProxyInfo.buildDirectProxy("localhost", listenPort);
+ builder.setHttpProxy(localPi);
+ } else {
+ builder.setHttpProxy(pi);
+ }
+ }
+ }
Log.i(TAG, "Builder 15");
builder.setBlocking(true);