I'm setting up and invoking the JBrowserDriver using the following Scala code:
new JBrowserDriver {
var settings = Settings
.builder()
.timezone(Timezone.EUROPE_BUDAPEST)
.blockAds(true)
.cache(cacheEnabled)
.cacheEntries(cacheSize)
.connectionReqTimeout(requestTimeout)
.connectTimeout(connectionTimeout)
.ajaxResourceTimeout(requestTimeout)
.socketTimeout(connectionTimeout)
.headless(true)
.hostnameVerification(false)
.ignoreDialogs(true)
.saveMedia(false)
/**
* @see [issue #220 on Github]
*/
.javaOptions(jvmOptions: _*)
.ssl("trustanything")
.userAgent(agent)
if (proxyEnabled) {
logInfo(s"Using proxy [$proxyHost:$proxyPort] with type [$proxyType].")
settings = settings.proxy(new ProxyConfig(proxyType, proxyHost, proxyPort))
}
settings.build()
}
}
A proxy should be available on localhost:8080 (socket). I have debugged the driver so far to verify that proxy settings reach correct variables, but I have found no evidence that the proxy settings are accessed on a code path that is actually executed. I execute a fetch with the following code:
b = pool.borrowObject(borrowMaximumWait)
b.get(address)
b.getPageSource
The getPageSource will return correctly even if the proxy is not running on port 8080.
Tried HTTP proxy as well, does not work - although worked through FireFox browser.
I'm looking for guidance to further debug the code, moreover, I have the following questions:
If a proxy connection fails, would the fetch b.get(address) also fail? In other words, will it fallback to a non-socket, default connection if the socket's port refuses connection?
Hi!
I'm setting up and invoking the
JBrowserDriver
using the following Scala code:A proxy should be available on
localhost:8080
(socket). I have debugged the driver so far to verify that proxy settings reach correct variables, but I have found no evidence that the proxy settings are accessed on a code path that is actually executed. I execute a fetch with the following code:The
getPageSource
will return correctly even if the proxy is not running on port8080
.Tried HTTP proxy as well, does not work - although worked through FireFox browser.
I'm looking for guidance to further debug the code, moreover, I have the following questions:
b.get(address)
also fail? In other words, will it fallback to a non-socket, default connection if the socket's port refuses connection?Cheers, Zoltán