java.lang.Object | |
↳ | org.apache.http.impl.conn.ProxySelectorRoutePlanner |
Default implementation of an HttpRoutePlanner
.
This implementation is based on java.net.ProxySelector.
By default, it will pick up the proxy settings of the JVM, either
from system properties or from the browser running the application.
Additionally, it interprets some
parameters
,
though not the DEFAULT_PROXY
.
The following parameters can be used to customize the behavior of this class:
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
proxySelector | The proxy selector to use, or null for system default. |
||||||||||
schemeRegistry | The scheme registry. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new proxy selector route planner.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Determines the route for a request.
| |||||||||||
Obtains the proxy selector to use.
| |||||||||||
Sets the proxy selector to use.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Chooses a proxy from a list of available proxies.
| |||||||||||
Determines a proxy for the given target.
| |||||||||||
Obtains a host from an InetSocketAddress.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.http.conn.routing.HttpRoutePlanner
|
The proxy selector to use, or null
for system default.
Creates a new proxy selector route planner.
schreg | the scheme registry |
---|---|
prosel | the proxy selector, or
null for the system default
|
Determines the route for a request.
target | the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request. |
---|---|
request | the request to execute |
context | the context to use for the subsequent execution.
Implementations may accept null . |
HttpException |
---|
Obtains the proxy selector to use.
null
for the system default
Sets the proxy selector to use.
prosel | the proxy selector, or
null to use the system default
|
---|
Chooses a proxy from a list of available proxies.
The default implementation just picks the first non-SOCKS proxy
from the list. If there are only SOCKS proxies,
Proxy.NO_PROXY
is returned.
Derived classes may implement more advanced strategies,
such as proxy rotation if there are multiple options.
proxies | the list of proxies to choose from,
never null or empty |
---|---|
target | the planned target, never null |
request | the request to be sent, never null |
context | the context, or null |
Determines a proxy for the given target.
target | the planned target, never null |
---|---|
request | the request to be sent, never null |
context | the context, or null |
null
for a direct routeHttpException | in case of system proxy settings that cannot be handled |
---|
Obtains a host from an InetSocketAddress.
isa | the socket address |
---|