diff options
-rw-r--r-- | tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java | 30 |
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 87886798..c4c72459 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); |