playframework/play-ws

No place to specify a socks4/5 proxy, unlike AsyncHttpClient

fancellu opened this issue · 9 comments

I can't see any place to specify that I'd like wsclient to use a socks proxy, whereas AsyncHttpClient can

https://www.javadoc.io/static/org.asynchttpclient/async-http-client/2.10.4/org/asynchttpclient/proxy/ProxyType.html

vs

Thanks

Here's a repo of mine, doing some socks proxy work, with sttp, various backends, even old HttpUrlConnection

https://github.com/fancellu/play-sttp-examples

Thanks for reporting this.

I added this issue to the backlog, but it can take sometime before someone can find time to pick it.

Would you be interested in sending a PR?

Sorry, I am up to my eyeballs, currently its not a big issue for me as I can use other solutions (as above)

Just found it odd/unexpected that play-ws didn't support it right now

No worries. That is indeed odd. I guess this is not so common case otherwise it would have been reported before.

If there is some interest in the community, it will get fixed sooner. Otherwise, it's when it becomes a priority.

In any case, thanks for reporting it.

There may well be another issue with ahc itself, that you might want to be aware of:

AsyncHttpClient/async-http-client#1682

If there is some interest in the community, it will get fixed sooner. Otherwise, it's when it becomes a priority.

Hi. Any progress on this? I would really like/need this feature. Thanks!

For the standalone client, you would do new StandaloneAhcWSClient(asyncHttpClient)

Unfortunately AHC doesn't do socks/tor name resolution properly, so I ended up using okttp, which does

AsyncHttpClient/async-http-client#1682

https://gist.github.com/fancellu/df6dde59249edf8401b28bbc44a78cbc