Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
I have searched and found https://github.com/imanel/websocket-ruby as the main ruby library for the client. In the back-end part I guess I should enable a channel with Action Cable and create a "consumer". Am I right? Is there any special code to avoid XSS or similar? Any advice?
Keep in mind that ActionCable implements its own JSON-based payload structure on top of web sockets. So you would need to build something on top of the basic web socket package to be able to exchange messages with a Rails backend. A quick google suggests there are a couple of ruby-based projects that have done that. You might check out action-cable-client, which doesn't look particularly maintained, but might give you a place to start.