ProxyConfig

public class ProxyConfig
extends Object

java.lang.Object
   ↳ androidx.webkit.ProxyConfig


Config for ProxyController.setProxyOverride(ProxyConfig, Executor, Runnable).

Proxy rules should be added using addProxyRule methods. Multiple rules can be used as fallback if a proxy fails to respond (for example, the proxy server is down). Bypass rules can be set for URLs that should not use these settings.

For instance, the following code means that WebView would first try to use proxy1.com for all URLs, if that fails, proxy2.com, and if that fails, it would make a direct connection.

 ProxyConfig proxyConfig = new ProxyConfig.Builder().addProxyRule("proxy1.com")
                                                    .addProxyRule("proxy2.com")
                                                    .addProxyRule(ProxyConfig.DIRECT)
                                                    .build();
 

Summary

Nested classes

class ProxyConfig.Builder

ProxyConfig builder. 

Constants

String DIRECT

Connect to URLs directly instead of using a proxy server.

String MATCH_ALL_SCHEMES

Matches all schemes.

String MATCH_HTTP

HTTP scheme.

String MATCH_HTTPS

HTTPS scheme.

Inherited methods

Constants

DIRECT

public static final String DIRECT

Connect to URLs directly instead of using a proxy server.

Constant Value: "direct://"

MATCH_ALL_SCHEMES

public static final String MATCH_ALL_SCHEMES

Matches all schemes.

Constant Value: "*"

MATCH_HTTP

public static final String MATCH_HTTP

HTTP scheme.

Constant Value: "http"

MATCH_HTTPS

public static final String MATCH_HTTPS

HTTPS scheme.

Constant Value: "https"