com.ning.http.util
public class ProxyUtils extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROXY_HOST
The host to use as proxy.
|
static java.lang.String |
PROXY_NONPROXYHOSTS
A specification of non-proxy hosts.
|
static java.lang.String |
PROXY_PASSWORD
The password to use for authentication for the proxy server.
|
static java.lang.String |
PROXY_PORT
The port to use for the proxy.
|
static java.lang.String |
PROXY_PROTOCOL
The protocol to use.
|
static java.lang.String |
PROXY_USER
The username to use for authentication for the proxy server.
|
Constructor and Description |
---|
ProxyUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
avoidProxy(ProxyServer proxyServer,
Request request)
Checks whether proxy should be used according to nonProxyHosts settings of it, or we want to go directly to
target host.
|
static boolean |
avoidProxy(ProxyServer proxyServer,
java.lang.String target)
Checks whether proxy should be used according to nonProxyHosts settings of it, or we want to go directly to
target host.
|
static ProxyServer |
createProxy(java.util.Properties properties)
Creates a proxy server instance from the given properties.
|
public static final java.lang.String PROXY_HOST
public static final java.lang.String PROXY_PORT
public static final java.lang.String PROXY_PROTOCOL
ProxyServer.Protocol
enum.public static final java.lang.String PROXY_NONPROXYHOSTS
public static final java.lang.String PROXY_USER
public static final java.lang.String PROXY_PASSWORD
public static boolean avoidProxy(ProxyServer proxyServer, Request request)
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.htmlproxyServer
- request
- public static boolean avoidProxy(ProxyServer proxyServer, java.lang.String target)
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.htmlproxyServer
- target
- the hostnamepublic static ProxyServer createProxy(java.util.Properties properties)
properties
- the properties to evaluate. Must not be null.http://download.oracle.com/javase/1.4.2/docs/guide/net/properties.html
,
PROXY_HOST
,
PROXY_PORT
,
PROXY_PROTOCOL
,
PROXY_NONPROXYHOSTS
Copyright © 2014. All Rights Reserved.