public class ProxyConfig extends Object implements Serializable
WebClient
class. One instance of this class exists for each WebClient
instance.WebClientOptions.getProxyConfig()
,
Serialized FormConstructor and Description |
---|
ProxyConfig()
Creates a new instance.
|
ProxyConfig(String proxyHost,
int proxyPort,
String proxyScheme)
Creates a new instance.
|
ProxyConfig(String proxyHost,
int proxyPort,
String proxyScheme,
boolean isSocks)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addHostsToProxyBypass(String pattern)
Any hosts matched by the specified regular expression pattern will bypass the configured proxy.
|
protected String |
getProxyAutoConfigContent()
Returns the proxy auto-config content.
|
String |
getProxyAutoConfigUrl()
Returns the proxy auto-config URL.
|
String |
getProxyHost()
Returns the proxy host used to perform HTTP requests.
|
int |
getProxyPort()
Returns the proxy port used to perform HTTP requests.
|
String |
getProxyScheme()
Returns the proxy scheme used to perform HTTP requests.
|
boolean |
isSocksProxy()
Returns whether SOCKS proxy or not.
|
void |
removeHostsFromProxyBypass(String pattern)
Any hosts matched by the specified regular expression pattern will no longer bypass the configured proxy.
|
protected void |
setProxyAutoConfigContent(String proxyAutoConfigContent)
Sets the proxy auto-config content.
|
void |
setProxyAutoConfigUrl(String proxyAutoConfigUrl)
Sets the proxy auto-config URL.
|
void |
setProxyHost(String proxyHost)
Sets the proxy host used to perform HTTP requests.
|
void |
setProxyPort(int proxyPort)
Sets the proxy port used to perform HTTP requests.
|
void |
setProxyPort(String proxyScheme)
Sets the proxy scheme used to perform HTTP requests.
|
void |
setSocksProxy(boolean isSocksProxy)
Sets whether SOCKS proxy or not.
|
protected boolean |
shouldBypassProxy(String hostname)
Returns
true if the host with the specified hostname should be accessed bypassing the
configured proxy. |
public ProxyConfig()
public ProxyConfig(String proxyHost, int proxyPort, String proxyScheme)
proxyHost
- the proxy hostproxyPort
- the proxy portproxyScheme
- the scheme http/https; null defaults to httppublic String getProxyHost()
public void setProxyHost(String proxyHost)
proxyHost
- the proxy host used to perform HTTP requestspublic int getProxyPort()
public void setProxyPort(int proxyPort)
proxyPort
- the proxy port used to perform HTTP requestspublic String getProxyScheme()
public void setProxyPort(String proxyScheme)
proxyScheme
- the proxy scheme used to perform HTTP requestspublic boolean isSocksProxy()
public void setSocksProxy(boolean isSocksProxy)
isSocksProxy
- whether SOCKS proxy or notpublic void addHostsToProxyBypass(String pattern)
pattern
- a regular expression pattern that matches the hostnames of the hosts which should
bypass the configured proxy.Pattern
public void removeHostsFromProxyBypass(String pattern)
pattern
- the previously added regular expression patternPattern
protected boolean shouldBypassProxy(String hostname)
true
if the host with the specified hostname should be accessed bypassing the
configured proxy.hostname
- the name of the host to checktrue
if the host with the specified hostname should be accessed bypassing the
configured proxy, false
otherwise.public String getProxyAutoConfigUrl()
public void setProxyAutoConfigUrl(String proxyAutoConfigUrl)
proxyAutoConfigUrl
- the proxy auto-config URLprotected String getProxyAutoConfigContent()
protected void setProxyAutoConfigContent(String proxyAutoConfigContent)
proxyAutoConfigContent
- the proxy auto-config contentCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.