| java.lang.Object java.net.ProxySelector sun.net.spi.DefaultProxySelector
DefaultProxySelector | public class DefaultProxySelector extends ProxySelector (Code) | | Supports proxy settings using system properties This proxy selector
provides backward compatibility with the old http protocol handler
as far as how proxy is set
Most of the implementation copied from the old http protocol handler
Supports http/https/ftp.proxyHost, http/https/ftp.proxyPort,
proxyHost, proxyPort, and http/https/ftp.nonProxyHost, and socks.
NOTE: need to do gopher as well
|
Inner Class :static class NonProxyInfo | |
Field Summary | |
final static String[][] | props This is where we define all the valid System Properties we have to
support for each given protocol. |
props | final static String[][] props(Code) | | This is where we define all the valid System Properties we have to
support for each given protocol.
The format of this 2 dimensional array is :
- 1 row per protocol (http, ftp, ...)
- 1st element of each row is the protocol name
- subsequent elements are prefixes for Host & Port properties
listed in order of priority.
Example:
{"ftp", "ftp.proxy", "ftpProxy", "proxy", "socksProxy"},
means for FTP we try in that oder:
+ ftp.proxyHost & ftp.proxyPort
+ ftpProxyHost & ftpProxyPort
+ proxyHost & proxyPort
+ socksProxyHost & socksProxyPort
Note that the socksProxy should *always* be the last on the list
|
select | public java.util.List<Proxy> select(URI uri)(Code) | | select() method. Where all the hard work is done.
Build a list of proxies depending on URI.
Since we're only providing compatibility with the system properties
from previous releases (see list above), that list will always
contain 1 single proxy, default being NO_PROXY.
|
|
|