public class Proxy
extends java.lang.Object
httpProxy
manually and then turn
on proxy autodetect.Modifier and Type | Class and Description |
---|---|
static class |
Proxy.ProxyType |
Modifier and Type | Field and Description |
---|---|
private boolean |
autodetect |
private java.lang.String |
ftpProxy |
private java.lang.String |
httpProxy |
private java.lang.String |
noProxy |
private java.lang.String |
proxyAutoconfigUrl |
private Proxy.ProxyType |
proxyType |
private java.lang.String |
socksPassword |
private java.lang.String |
socksProxy |
private java.lang.String |
socksUsername |
private java.lang.String |
sslProxy |
Constructor and Description |
---|
Proxy() |
Proxy(java.util.Map<java.lang.String,?> raw) |
Modifier and Type | Method and Description |
---|---|
static Proxy |
extractFrom(Capabilities capabilities) |
java.lang.String |
getFtpProxy()
Gets the FTP proxy.
|
java.lang.String |
getHttpProxy()
Gets the HTTP proxy.
|
java.lang.String |
getNoProxy()
Gets proxy bypass (noproxy) addresses.
|
java.lang.String |
getProxyAutoconfigUrl()
Gets the proxy auto-configuration URL.
|
Proxy.ProxyType |
getProxyType()
Gets the
Proxy.ProxyType . |
java.lang.String |
getSocksPassword()
Gets the SOCKS proxy's password.
|
java.lang.String |
getSocksProxy()
Gets the SOCKS proxy.
|
java.lang.String |
getSocksUsername()
Gets the SOCKS proxy's username.
|
java.lang.String |
getSslProxy()
Gets the SSL tunnel proxy.
|
boolean |
isAutodetect()
Whether to autodetect proxy settings.
|
Proxy |
setAutodetect(boolean autodetect)
Specifies whether to autodetect proxy settings.
|
Proxy |
setFtpProxy(java.lang.String ftpProxy)
Specify which proxy to use for FTP connections.
|
Proxy |
setHttpProxy(java.lang.String httpProxy)
Specify which proxy to use for HTTP connections.
|
Proxy |
setNoProxy(java.lang.String noProxy)
Sets proxy bypass (noproxy) addresses
|
Proxy |
setProxyAutoconfigUrl(java.lang.String proxyAutoconfigUrl)
Specifies the URL to be used for proxy auto-configuration.
|
Proxy |
setProxyType(Proxy.ProxyType proxyType)
Explicitly sets the proxy type, useful for forcing direct connection on Linux.
|
Proxy |
setSocksPassword(java.lang.String password)
Specifies a password for the SOCKS proxy.
|
Proxy |
setSocksProxy(java.lang.String socksProxy)
Specifies which proxy to use for SOCKS.
|
Proxy |
setSocksUsername(java.lang.String username)
Specifies a username for the SOCKS proxy.
|
Proxy |
setSslProxy(java.lang.String sslProxy)
Specify which proxy to use for SSL connections.
|
private void |
verifyProxyTypeCompatibility(Proxy.ProxyType compatibleProxy) |
private Proxy.ProxyType proxyType
private boolean autodetect
private java.lang.String ftpProxy
private java.lang.String httpProxy
private java.lang.String noProxy
private java.lang.String sslProxy
private java.lang.String socksProxy
private java.lang.String socksUsername
private java.lang.String socksPassword
private java.lang.String proxyAutoconfigUrl
public Proxy.ProxyType getProxyType()
Proxy.ProxyType
. This can signal if set to use a direct connection (without proxy),
manually set proxy settings, auto-configured proxy settings, or whether to use the default
system proxy settings. It defaults to Proxy.ProxyType.UNSPECIFIED
.public Proxy setProxyType(Proxy.ProxyType proxyType)
proxyType
- type of proxy being usedpublic boolean isAutodetect()
public Proxy setAutodetect(boolean autodetect)
autodetect
- set to true to use proxy auto detection, false to leave proxy settings
unspecifiedpublic java.lang.String getFtpProxy()
public Proxy setFtpProxy(java.lang.String ftpProxy)
ftpProxy
- the proxy host, expected format is hostname.com:1234
public java.lang.String getHttpProxy()
public Proxy setHttpProxy(java.lang.String httpProxy)
httpProxy
- the proxy host, expected format is hostname:1234
public java.lang.String getNoProxy()
public Proxy setNoProxy(java.lang.String noProxy)
noProxy
- The proxy bypass (noproxy) addressespublic java.lang.String getSslProxy()
public Proxy setSslProxy(java.lang.String sslProxy)
sslProxy
- the proxy host, expected format is hostname.com:1234
public java.lang.String getSocksProxy()
public Proxy setSocksProxy(java.lang.String socksProxy)
socksProxy
- the proxy host, expected format is hostname.com:1234
public java.lang.String getSocksUsername()
public Proxy setSocksUsername(java.lang.String username)
username
- username for the SOCKS proxypublic java.lang.String getSocksPassword()
public Proxy setSocksPassword(java.lang.String password)
password
- password for the SOCKS proxypublic java.lang.String getProxyAutoconfigUrl()
public Proxy setProxyAutoconfigUrl(java.lang.String proxyAutoconfigUrl)
http://hostname.com:1234/pacfile
. This is required if getProxyType()
is
set to Proxy.ProxyType.PAC
, ignored otherwise.proxyAutoconfigUrl
- the URL for proxy auto-configurationprivate void verifyProxyTypeCompatibility(Proxy.ProxyType compatibleProxy)
public static Proxy extractFrom(Capabilities capabilities)