public static final class HttpConfiguration.ProxyConfiguration
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
HttpConfiguration.ProxyConfiguration.Builder
Builder class for
HttpConfiguration.ProxyConfiguration . |
Modifier and Type | Method and Description |
---|---|
static HttpConfiguration.ProxyConfiguration.Builder |
custom(java.lang.String host,
int port)
Creates builder object for construction of
HttpConfiguration.ProxyConfiguration instance with custom host, port. |
java.lang.String |
getHost() |
int |
getPort() |
UserPassCredentials |
getUserPassCredentials() |
static HttpConfiguration.ProxyConfiguration.Builder |
systemDefault()
Creates builder object for construction of
HttpConfiguration.ProxyConfiguration
based on default ProxySelector configured on the JVM. |
boolean |
usesSystemDefaultProxyConfiguration() |
public static HttpConfiguration.ProxyConfiguration.Builder custom(java.lang.String host, int port)
HttpConfiguration.ProxyConfiguration
instance with custom host, port.
Default schema(http) is assumed.
Mind that only explicit credentials set via
HttpConfiguration.ProxyConfiguration.Builder.setUserPassCredentials(UserPassCredentials)
method
are supported in this case.
host
- is the proxy hostname or ipport
- is the proxy portpublic static HttpConfiguration.ProxyConfiguration.Builder systemDefault()
HttpConfiguration.ProxyConfiguration
based on default ProxySelector
configured on the JVM.
Mind that if the default ProxySelector
is unable to select a
proxy host corresponding to the respective target url, request will be
sent directly to the target host without passing through proxy.
Credentials set via the default Authenticator
would be used in case no explicit credentials are supplied via
HttpConfiguration.ProxyConfiguration.Builder.setUserPassCredentials(UserPassCredentials)
method.
Please mind that this method is intended primarily for testing purposes and its use in production code is discouraged, since it could lead to exposing an HTTPS server authentication credentials via a plain text network connection to an HTTP proxy if proxy asked for authentication. See OpenJDK: exposure of server authentication credentials to proxy
public java.lang.String getHost()
public int getPort()
public boolean usesSystemDefaultProxyConfiguration()
true
if system default proxy configuration is to be used.public UserPassCredentials getUserPassCredentials()
null
.