|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ning.http.util.ProxyUtils
public final class ProxyUtils
Utilities for Proxy handling.
Field Summary | |
---|---|
static String |
PROXY_HOST
The host to use as proxy. |
static String |
PROXY_NONPROXYHOSTS
A specification of non-proxy hosts. |
static String |
PROXY_PASSWORD
The password to use for authentication for the proxy server. |
static String |
PROXY_PORT
The port to use for the proxy. |
static String |
PROXY_PROTOCOL
The protocol to use. |
static String |
PROXY_USER
The username to use for authentication for the proxy server. |
Method Summary | |
---|---|
static boolean |
avoidProxy(ProxyServer proxyServer,
Request request)
|
static boolean |
avoidProxy(ProxyServer proxyServer,
String hostname)
Checks whether proxy should be used according to nonProxyHosts settings of it, or we want to go directly to target host. |
static ProxyServerSelector |
createProxyServerSelector(Properties properties)
Creates a proxy server instance from the given properties. |
static ProxyServerSelector |
createProxyServerSelector(ProxySelector proxySelector)
Create a proxy server selector based on the passed in JDK proxy selector. |
static ProxyServerSelector |
createProxyServerSelector(ProxyServer proxyServer)
Create a proxy server selector that always selects a single proxy server. |
static ProxyServerSelector |
getJdkDefaultProxyServerSelector()
Get a proxy server selector based on the JDK default proxy selector. |
static ProxyServer |
getProxyServer(AsyncHttpClientConfig config,
Request request)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROXY_HOST
public static final String PROXY_PORT
public static final String PROXY_PROTOCOL
ProxyServer.Protocol
enum.
public static final String PROXY_NONPROXYHOSTS
public static final String PROXY_USER
public static final String PROXY_PASSWORD
Method Detail |
---|
public static ProxyServer getProxyServer(AsyncHttpClientConfig config, Request request)
config
- the global configrequest
- the request
public static boolean avoidProxy(ProxyServer proxyServer, Request request)
avoidProxy(ProxyServer, String)
public static boolean avoidProxy(ProxyServer proxyServer, String hostname)
null
proxy is passed in, this method returns true -- since there is NO proxy, we
should avoid to use it. Simple hostname pattern matching using "*" are supported, but only as prefixes.
See http://download.oracle.com/javase/1.4.2/docs/guide/net/properties.html
proxyServer
- hostname
- the hostname
public static ProxyServerSelector createProxyServerSelector(Properties properties)
properties
- the properties to evaluate. Must not be null.
PROXY_HOST
,
PROXY_PORT
,
PROXY_PROTOCOL
,
PROXY_NONPROXYHOSTS
public static ProxyServerSelector getJdkDefaultProxyServerSelector()
public static ProxyServerSelector createProxyServerSelector(ProxySelector proxySelector)
proxySelector
- The proxy selector to use. Must not be null.
public static ProxyServerSelector createProxyServerSelector(ProxyServer proxyServer)
proxyServer
- The proxy server to select.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |