socketry / async-websocket

Asynchronous WebSocket client and server, supporting HTTP/1 and HTTP/2 for Ruby.
MIT License
166 stars 18 forks source link

Any way to connect via a proxy? #17

Closed zgalili closed 4 years ago

zgalili commented 4 years ago

Hi :)

In our production environment we need to connect trough a proxy, is there any way to do it with async-websocket?

Thanks, Ziv.

ioquatix commented 4 years ago

Yes, it's possible.

You need to create an HTTP client connected to your proxy with the appropriate authentication.

Then you need to create a proxied endpoint, e.g. https://github.com/socketry/async-http/blob/master/spec/async/http/proxy_spec.rb#L33-L36

Then you need to use async web socket to connect via this proxied endpoint.

If you are using this in a commercial project, please consider sponsoring this project. Higher levels of sponsorship will allow me to dedicate time to your specific problems, including the eco-system for everyone!

ioquatix commented 4 years ago

Another company sponsored the proxy implementation. It's part of async-http.