I would like to do something like this:
val httpProtocol: HttpProtocolBuilder = http
.baseUrl(system_env)
.acceptHeader("application/json")
.acceptEncodingHeader("gzip, deflate, br")
if(proxyEnabled) {
httpProtocol.proxy(Proxy("proxy_server", port)
.httpsPort(port)
.credentials(proxyUsername, proxyPassword))
}
But it doesn’t work for some reason with that if statement there.
When I have it like this:
val httpProtocol: HttpProtocolBuilder = http
.baseUrl(system_env)
.acceptHeader("application/json")
.acceptEncodingHeader("gzip, deflate, br")
.proxy(Proxy("proxy_server", port)
.httpsPort(port)
.credentials(proxyUsername, proxyPassword))
then my proxy is taken into account.
How to do this properly?