How does kamal-proxy handle web socket connections? #157
-
|
I had a problem with Passenger where I forgot that I needed to configure a special endpoint for I haven't seen any mention of special treatment in the Kamal / kamal-proxy environment of web sockets and particularly the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
You don't need to do anything at the Kamal Proxy level. WebSocket connections are proxied automatically to your app, and having (potentially lots of) long-lived connections is not a very significant burden on the proxy. In the Rails app, Action Cable will serve these without consuming Puma workers, so up to a certain scale you should be fine with the out-of-the-box behaviour. It should all work correctly by default. If you find that the load of serving WebSocket traffic becomes a problem for your main app at some point, you could also split the cable traffic out to its own deployment, using Kamal's path-based routing to separate that traffic. But that's really an app-level concern; it doesn't involve any other settings in the proxy. So tl/dr, you don't have to do anything :) Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
|
Nice! Yes I was hoping that would be the case :D I was just sensitive to it because of my experience with Passenger! :D |
Beta Was this translation helpful? Give feedback.
You don't need to do anything at the Kamal Proxy level. WebSocket connections are proxied automatically to your app, and having (potentially lots of) long-lived connections is not a very significant burden on the proxy. In the Rails app, Action Cable will serve these without consuming Puma workers, so up to a certain scale you should be fine with the out-of-the-box behaviour. It should all work correctly by default.
If you find that the load of serving WebSocket traffic becomes a problem for your main app at some point, you could also split the cable traffic out to its own deployment, using Kamal's path-based routing to separate that traffic. But that's really an app-level concern; it doe…