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

Websocket support? #56

Open
focused opened this issue Aug 22, 2019 · 8 comments
Open

Websocket support? #56

focused opened this issue Aug 22, 2019 · 8 comments

Comments

@focused
Copy link

focused commented Aug 22, 2019

This the most awesome package for proxying, but it does not work with websockets, the error code 426 Upgrade Required received when i try to proxy "ws://" request. I found that "connection" and "upgrade" are disabled in remove_hop_by_hop_headers function. Are you going to support WS?

@msz
Copy link
Contributor

msz commented Aug 29, 2019

Hi, thanks for your interest!

This is definitely something we would like to implement properly, but unfortunately it is not on our priority list right now. In the meantime we welcome pull requests towards this.

@minidfx
Copy link

minidfx commented Sep 21, 2022

Any recommendations to start this issue ? Websockex as client ? Purely forwarding the frames TCP ?

@minidfx
Copy link

minidfx commented Oct 22, 2022

Soon as this pull request(elixir-plug/plug_cowboy#88) is merged, I will try to implement the websocket proxying with gun(https://github.com/ninenines/gun) as internal client for proxing frames to the upstreams.

@minidfx
Copy link

minidfx commented Nov 1, 2022

Ok the support for the websocket has been merged into plug_cowboy: https://hexdocs.pm/plug_cowboy/Plug.Cowboy.html#module-websocket-support

@hubertlepicki
Copy link

@minidfx I am interested in proxying websockets too, did you manage to find a solution?

@minidfx
Copy link

minidfx commented Mar 24, 2023

Yep, I moved to nginx ;)

@hubertlepicki
Copy link

@minidfx attaboy ;). Okay in that case I need to give it a shot myself as I need it done programmatically :/

@minidfx
Copy link

minidfx commented Mar 29, 2023

But you can check the package plug_cowboy, recently the support of the websocket was added, it was really not easy to send the messages to the backend server and reply to the clients.

I spend too much time without a good result with websocket in this project: https://github.com/minidfx/elixir-reverse-proxy

Useful links:

Have fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants