Open adamstarlight opened 2 years ago
Checked network traffic in Wireshark. Node.js seem to connect to proxy using HTTPS, while sttp does not use TLS at all. Is there any way to customize this behavior?
Given up on Async-http-client, this should not be this hard and disappointing to figure simple configurations... And thank you all for supporting multiple backends! Armeria was so much friendlier)
val proxyConfig =
ProxyConfig.connect(new InetSocketAddress("***proxy-ip***", 443), true)
val clientFactory = ClientFactory.builder().proxyConfig(proxyConfig).build()
val webClient = WebClient.builder().factory(clientFactory).build()
val buildBackend = ArmeriaZioBackend.usingClient(webClient)
Thanks for the report. Maybe we are integrating with async-http-client incorrectly someplace, that would need testing. But on first look, there's no special options available for https. So to debug and determine if it's a problem with sttp or async-http-client, we'd first need to reproduce (or not) using async-http-client itself.
Out of curiosity, didn't setting the proxy using SttpBackendOptions.httpProxy
work for you with the armeria backend?
FWIW I am having similar proxy usage related issues with AsyncHttpClientCatsBackend
. May not be the exact same problem in my case but definitely there are issues around using proxies with async.
I'm trying to make a request through a secure http proxy using
sttp
andasync-http-client-backend-zio1
client. The proxy (squid) is working fine, I was able to connect through it on node.js without any issues at all. Here is how it was implemented in Javascript:However recreating something similar in Scala proven to be much more difficult! I used code below to make a request. This solution fails with
Bad request
,Client sent an HTTP request to an HTTPS server.
.How to correctly configure secure proxy using sttp?