public class Proxy extends Object
httpProxy
manually and then turn
on proxy autodetect.Modifier and Type | Class and Description |
---|---|
static class |
Proxy.ProxyType |
Modifier and Type | Method and Description |
---|---|
String |
getFtpProxy()
Gets the FTP proxy.
|
String |
getHttpProxy()
Gets the HTTP proxy.
|
String |
getNoProxy()
Gets proxy bypass (noproxy) addresses.
|
String |
getProxyAutoconfigUrl()
Gets the proxy auto-configuration URL.
|
Proxy.ProxyType |
getProxyType()
Gets the
Proxy.ProxyType . |
String |
getSocksPassword()
Gets the SOCKS proxy's password.
|
String |
getSocksProxy()
Gets the SOCKS proxy.
|
String |
getSocksUsername()
Gets the SOCKS proxy's username.
|
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(String ftpProxy)
Specify which proxy to use for FTP connections.
|
Proxy |
setHttpProxy(String httpProxy)
Specify which proxy to use for HTTP connections.
|
Proxy |
setNoProxy(String noProxy)
Sets proxy bypass (noproxy) addresses
|
Proxy |
setProxyAutoconfigUrl(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(String password)
Specifies a password for the SOCKS proxy.
|
Proxy |
setSocksProxy(String socksProxy)
Specifies which proxy to use for SOCKS.
|
Proxy |
setSocksUsername(String username)
Specifies a username for the SOCKS proxy.
|
Proxy |
setSslProxy(String sslProxy)
Specify which proxy to use for SSL connections.
|
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)
public boolean isAutodetect()
public Proxy setAutodetect(boolean autodetect)
autodetect
- set to true to use proxy auto detection, false to leave proxy settings
unspecifiedpublic String getFtpProxy()
public Proxy setFtpProxy(String ftpProxy)
ftpProxy
- the proxy host, expected format is hostname.com:1234
public String getHttpProxy()
public Proxy setHttpProxy(String httpProxy)
httpProxy
- the proxy host, expected format is hostname:1234
public String getNoProxy()
public Proxy setNoProxy(String noProxy)
noProxy
- The proxy bypass (noproxy) addressespublic String getSslProxy()
public Proxy setSslProxy(String sslProxy)
sslProxy
- the proxy host, expected format is hostname.com:1234
public String getSocksProxy()
public Proxy setSocksProxy(String socksProxy)
socksProxy
- the proxy host, expected format is hostname.com:1234
public String getSocksUsername()
public Proxy setSocksUsername(String username)
username
- username for the SOCKS proxypublic String getSocksPassword()
public Proxy setSocksPassword(String password)
password
- password for the SOCKS proxypublic String getProxyAutoconfigUrl()
public Proxy setProxyAutoconfigUrl(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-configurationCopyright © 2014. All rights reserved.