Class ProxyConfigBean
- java.lang.Object
-
- org.openqa.selenium.htmlunit.options.ProxyConfigBean
-
- All Implemented Interfaces:
Serializable
public class ProxyConfigBean extends Object implements 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 fromProxyConfig.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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ProxyConfigBean()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ProxyConfigbuild()Builds aProxyConfigobject from this bean.static Map<String,Object>encodeProxyConfig(ProxyConfig value)Encodes aProxyConfigobject into aMaprepresentation.StringgetAutoConfigUrl()Returns the auto-configuration URL.List<String>getBypassHosts()Returns the list of bypass hosts.StringgetBypassHosts(int index)Returns a bypass host at the specified index.StringgetHost()Returns the proxy host.intgetPort()Returns the proxy port.StringgetScheme()Returns the proxy scheme.booleanisSocksProxy()Indicates 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.voidsetHost(String host)Sets the proxy host.voidsetPort(int port)Sets the proxy port.voidsetScheme(String scheme)Sets the proxy scheme.voidsetSocksProxy(boolean socksProxy)Sets whether this is a SOCKS proxy.
-
-
-
Method Detail
-
getHost
public String getHost()
Returns the proxy host.- Returns:
- the proxy host
-
setHost
public void setHost(String host)
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
public String getScheme()
Returns the proxy scheme.- Returns:
- the proxy scheme
-
setScheme
public void setScheme(String scheme)
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
public List<String> getBypassHosts()
Returns the list of bypass hosts.- Returns:
- the list of bypass hosts
-
getBypassHosts
public String getBypassHosts(int index)
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
public void setBypassHosts(List<String> bypassHosts)
Sets the list of bypass hosts.- Parameters:
bypassHosts- the list of bypass hosts to set
-
setBypassHosts
public void setBypassHosts(int index, String bypassHost)Sets a specific bypass host at the given index.- Parameters:
index- the index to setbypassHost- the bypass host to set
-
getAutoConfigUrl
public String getAutoConfigUrl()
Returns the auto-configuration URL.- Returns:
- the auto-config URL
-
setAutoConfigUrl
public void setAutoConfigUrl(String autoConfigUrl)
Sets the auto-configuration URL.- Parameters:
autoConfigUrl- the URL to set
-
encodeProxyConfig
public static Map<String,Object> encodeProxyConfig(ProxyConfig value)
Encodes aProxyConfigobject into aMaprepresentation.- Parameters:
value- theProxyConfigto encode- Returns:
- a map representing the proxy configuration
-
build
public ProxyConfig build()
Builds aProxyConfigobject from this bean.- Returns:
- a
ProxyConfigwith the properties of this bean
-
-