WebSockets

sample clients and servers

Implementing

Crystal

  • Kemal has built-in support
  • Lucky doesn’t
  • Amber has an abstraction over WebSockets

JavaScript

  • Client: WebSocket built in to browser and React Native
  • Server: ws

Ruby

  • Action Cable is not standard WebSocket protocol, and its client JS library only runs in the browser, not React Native
  • faye-websocket is standard WebSockets

Testing

$ npm install -g wscat
$ wscat -c ws://localhost:3001