A sandbox for building out a high-productivity approach to standard WebSockets in Ruby.
Includes an abstract ConnectionHandler
that can be adapted to multiple Ruby WebSocket implementations, or even other kinds of messaging.
Includes two implementations:
faye-websocket
running onpuma
async-websocket
running onfalcon
- Ruby
- Postgres, including PG command line tools
$ createdb ruby_websocket_sandbox_development
$ rake db:migrate
$ bin/falcon
or
$ bin/puma
$ npm install -g wscat
$ wscat -c localhost:3000
Note that with async/falcon
the message needs to be valid JSON, so you need to wrap strings in quotes. With faye/puma
the message is treated as a string, so no special handling is needed.
$ rake console
Models will be available.