Package org.asynchttpclient.util
Class ProxyUtils
- java.lang.Object
-
- org.asynchttpclient.util.ProxyUtils
-
public final class ProxyUtils extends Object
Utilities for Proxy handling.- Author:
- cstamas
-
-
Field Summary
Fields Modifier and Type Field Description static StringPROXY_HOSTThe host to use as proxy.static StringPROXY_NONPROXYHOSTSA specification of non-proxy hosts.static StringPROXY_PORTThe port to use for the proxy.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ProxyServerSelectorcreateProxyServerSelector(Properties properties)Creates a proxy server instance from the given properties.static ProxyServerSelectorgetJdkDefaultProxyServerSelector()Get a proxy server selector based on the JDK default proxy selector.static @Nullable ProxyServergetProxyServer(AsyncHttpClientConfig config, Request request)
-
-
-
Field Detail
-
PROXY_HOST
public static final String PROXY_HOST
The host to use as proxy.- See Also:
- Networking Properties, Constant Field Values
-
PROXY_PORT
public static final String PROXY_PORT
The port to use for the proxy.- See Also:
- Networking Properties, Constant Field Values
-
PROXY_NONPROXYHOSTS
public static final String PROXY_NONPROXYHOSTS
A specification of non-proxy hosts.- See Also:
- Networking Properties, Constant Field Values
-
-
Method Detail
-
getProxyServer
@Nullable public static @Nullable ProxyServer getProxyServer(AsyncHttpClientConfig config, Request request)
- Parameters:
config- the global configrequest- the request- Returns:
- the proxy server to be used for this request (can be null)
-
createProxyServerSelector
public static ProxyServerSelector createProxyServerSelector(Properties properties)
Creates a proxy server instance from the given properties. Currently, the default http.* proxy properties are supported as well as properties specific for AHC.- Parameters:
properties- the properties to evaluate. Must not be null.- Returns:
- a ProxyServer instance or null, if no valid properties were set.
- See Also:
- Networking Properties,
PROXY_HOST,PROXY_PORT,PROXY_NONPROXYHOSTS
-
getJdkDefaultProxyServerSelector
public static ProxyServerSelector getJdkDefaultProxyServerSelector()
Get a proxy server selector based on the JDK default proxy selector.- Returns:
- The proxy server selector.
-
-