|
|
|
|
@ -17,7 +17,6 @@ import java.util.List; |
|
|
|
|
|
|
|
|
|
public class ProxySelector extends java.net.ProxySelector { |
|
|
|
|
|
|
|
|
|
private static final String TAG = ProxySelector.class.getSimpleName(); |
|
|
|
|
private List<String> hosts; |
|
|
|
|
private Proxy proxy; |
|
|
|
|
|
|
|
|
|
@ -31,7 +30,6 @@ public class ProxySelector extends java.net.ProxySelector { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public List<Proxy> select(URI uri) { |
|
|
|
|
Logger.t(TAG).d(uri.getHost()); |
|
|
|
|
if (proxy == null || hosts == null || hosts.isEmpty() || uri.getHost() == null || "127.0.0.1".equals(uri.getHost())) return Collections.singletonList(Proxy.NO_PROXY); |
|
|
|
|
for (String host : hosts) if (Util.containOrMatch(uri.getHost(), host)) return Collections.singletonList(proxy); |
|
|
|
|
return Collections.singletonList(Proxy.NO_PROXY); |
|
|
|
|
|