Java.Net.ProxySelector Class
Selects the proxy server to use, if any, when connecting to a given URL.

See Also: ProxySelector Members

Syntax

[Android.Runtime.Register("java/net/ProxySelector", DoNotGenerateAcw=true)]
public abstract class ProxySelector : Java.Lang.Object

Remarks

Selects the proxy server to use, if any, when connecting to a given URL.

System Properties

The default proxy selector is configured by system properties.
Hostname patterns
URL schemeproperty namedescriptiondefault
ftpftp.nonProxyHostsHostname pattern for FTP servers to connect to directly (without a proxy).
httphttp.nonProxyHostsHostname pattern for HTTP servers to connect to directly (without a proxy).
httpshttps.nonProxyHostsHostname pattern for HTTPS servers to connect to directly (without a proxy).


NoType:java/net/Proxy$Type;Href=../../../reference/java/net/Proxy.Type.html#HTTP
URL schemeproperty namedescriptiondefault
ftpftp.proxyHostHostname of the HTTP proxy server used for FTP requests.
ftp.proxyPortPort number of the HTTP proxy server used for FTP requests.80
httphttp.proxyHostHostname of the HTTP proxy server used for HTTP requests.
http.proxyPortPort number of the HTTP proxy server used for HTTP requests.80
httpshttps.proxyHostHostname of the HTTP proxy server used for HTTPS requests.
https.proxyPortPort number of the HTTP proxy server used for HTTPS requests.443
ftp, http or httpsproxyHostHostname of the HTTP proxy server used for FTP, HTTP and HTTPS requests.
proxyPortPort number of the HTTP proxy server.80 for FTP and HTTP

443 for HTTPS


NoType:java/net/Proxy$Type;Href=../../../reference/java/net/Proxy.Type.html#SOCKS
URL schemeproperty namedescriptiondefault
ftp, http, https or socketsocksProxyHostHostname of the SOCKS proxy server used for FTP, HTTP, HTTPS and raw sockets.

Raw socket URLs are of the form socket://host:port
socksProxyPortPort number of the SOCKS proxy server.1080

Hostname patterns specify which hosts should be connected to directly, ignoring any other proxy system properties. If the URL's host matches the corresponding hostname pattern, Proxy.NoProxy is returned.

The format of a hostname pattern is a list of hostnames that are separated by | and that use * as a wildcard. For example, setting the http.nonProxyHosts property to *.android.com|*.kernel.org will cause requests to http://developer.android.com to be made without a proxy.

The default proxy selector always returns exactly one proxy. If no proxy is applicable, Proxy.NoProxy is returned. If multiple proxies are applicable, such as when both the proxyHost and socksProxyHost system properties are set, the result is the property listed earliest in the table above.

Alternatives

To request a URL without involving the system proxy selector, explicitly specify a proxy or Proxy.NoProxy using URL.OpenConnection(Proxy).

Use ProxySelector.Default to install a custom proxy selector.

[Android Documentation]

Requirements

Namespace: Java.Net
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1