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 |
Constructor and Description |
---|
Proxy() |
Proxy(java.util.Map<java.lang.String,?> raw) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
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.Integer |
getSocksVersion()
Gets the SOCKS version (4 or 5).
|
java.lang.String |
getSslProxy()
Gets the SSL tunnel proxy.
|
int |
hashCode() |
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 |
setSocksVersion(java.lang.Integer socksVersion)
Specifies which version of SOCKS to use (4 or 5).
|
Proxy |
setSslProxy(java.lang.String sslProxy)
Specify which proxy to use for SSL connections.
|
java.util.Map<java.lang.String,java.lang.Object> |
toJson() |
java.lang.String |
toString() |
public java.util.Map<java.lang.String,java.lang.Object> toJson()
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.Integer getSocksVersion()
public Proxy setSocksVersion(java.lang.Integer socksVersion)
socksVersion
- SOCKS version, 4 or 5public 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-configurationpublic static Proxy extractFrom(Capabilities capabilities)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object