public final class Proxy extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EXTRA_PROXY_INFO |
static String |
PROXY_CHANGE_ACTION
Used to notify an app that's caching the default connection proxy
that either the default connection or its proxy has changed.
|
Constructor and Description |
---|
Proxy() |
Modifier and Type | Method and Description |
---|---|
static HttpRoutePlanner |
getAndroidProxySelectorRoutePlanner(Context context) |
static String |
getDefaultHost()
Deprecated.
Use standard java vm proxy values to find the host, port and
exclusion list. This call ignores the exclusion list and no
longer reports only mobile-data apn-based proxy values.
|
static int |
getDefaultPort()
Deprecated.
Use standard java vm proxy values to find the host, port and
exclusion list. This call ignores the exclusion list and no
longer reports only mobile-data apn-based proxy values.
|
static String |
getHost(Context ctx)
Deprecated.
Use standard java vm proxy values to find the host, port
and exclusion list. This call ignores the exclusion list.
|
static int |
getPort(Context ctx)
Deprecated.
Use standard java vm proxy values to find the host, port
and exclusion list. This call ignores the exclusion list.
|
static HttpHost |
getPreferredHttpHost(Context context,
String url)
Returns the preferred proxy to be used by clients.
|
static Proxy |
getProxy(Context ctx,
String url)
Return the proxy object to be used for the URL given as parameter.
|
static void |
setHttpProxySystemProperty(ProxyProperties p) |
static void |
setHttpProxySystemProperty(String host,
String port,
String exclList) |
static void |
validate(String hostname,
String port,
String exclList)
Validate syntax of hostname, port and exclusion list entries
|
public static final String PROXY_CHANGE_ACTION
This is a protected intent that can only be sent by the system
public static final String EXTRA_PROXY_INFO
public static final Proxy getProxy(Context ctx, String url)
ctx
- A Context used to get the settings for the proxy host.url
- A URL to be accessed. Used to evaluate exclusion list.public static final String getHost(Context ctx)
ctx
- A Context used to get the settings for the proxy host.public static final int getPort(Context ctx)
ctx
- A Context used to get the settings for the proxy port.public static final String getDefaultHost()
public static final int getDefaultPort()
public static final HttpHost getPreferredHttpHost(Context context, String url)
android.net.Proxy#getHost()
.context
- the context which will be passed to
android.net.Proxy#getHost()
url
- the target URL for the requestpublic static void validate(String hostname, String port, String exclList)
public static final HttpRoutePlanner getAndroidProxySelectorRoutePlanner(Context context)
public static final void setHttpProxySystemProperty(ProxyProperties p)