Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fancellu opened this issue Nov 20, 2019 · 9 comments · May be fixed by #473
Open

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

fancellu opened this issue Nov 20, 2019 · 9 comments · May be fixed by #473

Comments

@fancellu
Copy link

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

@fancellu
Copy link
Author

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

@octonato
Copy link
Contributor

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?

@fancellu
Copy link
Author

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

@octonato
Copy link
Contributor

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.

@octonato octonato added this to the 2.x milestone Nov 28, 2019
@fancellu
Copy link
Author

fancellu commented Dec 9, 2019

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

AsyncHttpClient/async-http-client#1682

@johnkjellberg
Copy link

johnkjellberg commented Feb 24, 2020

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!

@wsargent
Copy link
Member

wsargent commented Feb 24, 2020

You can pass in an already configured AHC client into Play that does have SOCKS configured:

https://github.com/playframework/playframework/blob/master/transport/client/play-ahc-ws/src/main/scala/play/api/libs/ws/ahc/AhcWSModule.scala#L220

@wsargent
Copy link
Member

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

@fancellu
Copy link
Author

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

@octonato octonato removed this from the 2.x milestone Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants