diff options
Diffstat (limited to 'tunnel/src')
-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 b5b81ebc..90dd7534 100644 --- a/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java +++ b/tunnel/src/main/java/com/wireguard/android/backend/GoBackend.java @@ -526,21 +526,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); |