ProxyConfig

open class ProxyConfig
kotlin.Any
   ↳ 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

ProxyConfig builder.

Constants

static String

Connect to URLs directly instead of using a proxy server.

static String

Matches all schemes.

static String

HTTP scheme.

static String

HTTPS scheme.

Constants

DIRECT

static val DIRECT: String

Connect to URLs directly instead of using a proxy server.

Value: "direct://"

MATCH_ALL_SCHEMES

static val MATCH_ALL_SCHEMES: String

Matches all schemes.

Value: "*"

MATCH_HTTP

static val MATCH_HTTP: String

HTTP scheme.

Value: "http"

MATCH_HTTPS

static val MATCH_HTTPS: String

HTTPS scheme.

Value: "https"