Class ProxyConfigBean
java.lang.Object
org.openqa.selenium.htmlunit.options.ProxyConfigBean
- All Implemented Interfaces:
Serializable
A JavaBean representation of a proxy configuration. This class provides getters and setters
for common proxy properties such as host, port, scheme, SOCKS flag, bypass hosts, and
auto-configuration URL. It also provides utilities to convert to and from
ProxyConfig.
Example usage:
ProxyConfigBean bean = new ProxyConfigBean();
bean.setHost("proxy.example.com");
bean.setPort(8080);
bean.setScheme("http");
bean.setSocksProxy(false);
bean.setBypassHosts(Arrays.asList("localhost", "127.0.0.1"));
ProxyConfig proxyConfig = bean.build();
- Author:
- Scott Babcock, Ronald Brill
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aProxyConfigobject from this bean.encodeProxyConfig(ProxyConfig value) Encodes aProxyConfigobject into aMaprepresentation.Returns the auto-configuration URL.Returns the list of bypass hosts.getBypassHosts(int index) Returns a bypass host at the specified index.getHost()Returns the proxy host.intgetPort()Returns the proxy port.Returns the proxy scheme.booleanIndicates if this is a SOCKS proxy.voidsetAutoConfigUrl(String autoConfigUrl) Sets the auto-configuration URL.voidsetBypassHosts(int index, String bypassHost) Sets a specific bypass host at the given index.voidsetBypassHosts(List<String> bypassHosts) Sets the list of bypass hosts.voidSets the proxy host.voidsetPort(int port) Sets the proxy port.voidSets the proxy scheme.voidsetSocksProxy(boolean socksProxy) Sets whether this is a SOCKS proxy.
-
Constructor Details
-
ProxyConfigBean
public ProxyConfigBean()
-
-
Method Details
-
getHost
Returns the proxy host.- Returns:
- the proxy host
-
setHost
Sets the proxy host.- Parameters:
host- the proxy host to set
-
getPort
public int getPort()Returns the proxy port.- Returns:
- the proxy port
-
setPort
public void setPort(int port) Sets the proxy port.- Parameters:
port- the proxy port to set
-
getScheme
Returns the proxy scheme.- Returns:
- the proxy scheme
-
setScheme
Sets the proxy scheme.- Parameters:
scheme- the proxy scheme to set
-
isSocksProxy
public boolean isSocksProxy()Indicates if this is a SOCKS proxy.- Returns:
trueif SOCKS proxy,falseotherwise
-
setSocksProxy
public void setSocksProxy(boolean socksProxy) Sets whether this is a SOCKS proxy.- Parameters:
socksProxy-trueto use SOCKS proxy,falseotherwise
-
getBypassHosts
Returns the list of bypass hosts.- Returns:
- the list of bypass hosts
-
getBypassHosts
Returns a bypass host at the specified index.- Parameters:
index- the index of the bypass host- Returns:
- the bypass host at the specified index
-
setBypassHosts
Sets the list of bypass hosts.- Parameters:
bypassHosts- the list of bypass hosts to set
-
setBypassHosts
Sets a specific bypass host at the given index.- Parameters:
index- the index to setbypassHost- the bypass host to set
-
getAutoConfigUrl
Returns the auto-configuration URL.- Returns:
- the auto-config URL
-
setAutoConfigUrl
Sets the auto-configuration URL.- Parameters:
autoConfigUrl- the URL to set
-
encodeProxyConfig
Encodes aProxyConfigobject into aMaprepresentation.- Parameters:
value- theProxyConfigto encode- Returns:
- a map representing the proxy configuration
-
build
Builds aProxyConfigobject from this bean.- Returns:
- a
ProxyConfigwith the properties of this bean
-