Class HttpSnifferConfig
java.lang.Object
com.norconex.crawler.web.fetch.impl.webdriver.HttpSnifferConfig
Configuration for HttpSniffer.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanGets chained proxy settings, if any.getHost()The host name passed to the browser pointing to the sniffer proxy.intMaximum byte size before a request/response content is considered too large.Network interface address (IP) to be used by the sniffer proxy to listen for incoming connections.intgetPort()The host port passed to the browser pointing to the sniffer proxy.Gets the request headers to add to every HTTP request.Maximum wait time for the target host to respond.Optionally overwrite browser user agent.inthashCode()setChainedProxy(ProxySettings chainedProxy) Sets chained proxy settings, if any.The host name passed to the browser pointing to the sniffer proxy.setMaxBufferSize(int maxBufferSize) Maximum byte size before a request/response content is considered too large.setNetworkInterface(String networkInterface) Network interface address (IP) to be used by the sniffer proxy to listen for incoming connections.setPort(int port) The host port passed to the browser pointing to the sniffer proxy.setRequestHeaders(Map<String, String> requestHeaders) Sets the request headers to add to every HTTP request.setResponseTimeout(Duration responseTimeout) Maximum wait time for the target host to respond.setUserAgent(String userAgent) Optionally overwrite browser user agent.toString()
-
Field Details
-
DEFAULT_MAX_BUFFER_SIZE
public static final int DEFAULT_MAX_BUFFER_SIZE -
DEFAULT_RESPONSE_TIMEOUT
-
-
Constructor Details
-
HttpSnifferConfig
public HttpSnifferConfig()
-
-
Method Details
-
getRequestHeaders
Gets the request headers to add to every HTTP request.- Returns:
- map of request headers
-
setRequestHeaders
Sets the request headers to add to every HTTP request.- Parameters:
requestHeaders- map of request headers- Returns:
- this
-
getChainedProxy
Gets chained proxy settings, if any. That is, when the sniffer proxy has to itself use a proxy.- Returns:
- chained proxy settings
-
setChainedProxy
Sets chained proxy settings, if any. That is, when the sniffer proxy has to itself use a proxy.- Parameters:
chainedProxy- chained proxy settings- Returns:
- this
-
getPort
public int getPort()The host port passed to the browser pointing to the sniffer proxy. Defaults to 0 (random free port). -
getHost
The host name passed to the browser pointing to the sniffer proxy. Defaults to "localhost". -
getUserAgent
Optionally overwrite browser user agent. -
getMaxBufferSize
public int getMaxBufferSize()Maximum byte size before a request/response content is considered too large. Can be specified using notations, e.g., 25MB. Defaults toDEFAULT_MAX_BUFFER_SIZE(10 MB). -
getResponseTimeout
Maximum wait time for the target host to respond. -
getNetworkInterface
Network interface address (IP) to be used by the sniffer proxy to listen for incoming connections. Defaults to "0.0.0.0" (all interfaces). -
setPort
The host port passed to the browser pointing to the sniffer proxy. Defaults to 0 (random free port).- Returns:
this.
-
setHost
The host name passed to the browser pointing to the sniffer proxy. Defaults to "localhost".- Returns:
this.
-
setUserAgent
Optionally overwrite browser user agent.- Returns:
this.
-
setMaxBufferSize
Maximum byte size before a request/response content is considered too large. Can be specified using notations, e.g., 25MB. Defaults toDEFAULT_MAX_BUFFER_SIZE(10 MB).- Returns:
this.
-
setResponseTimeout
Maximum wait time for the target host to respond.- Returns:
this.
-
setNetworkInterface
Network interface address (IP) to be used by the sniffer proxy to listen for incoming connections. Defaults to "0.0.0.0" (all interfaces).- Returns:
this.
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-