This is a proof of concept for Rack based Websocket connections, showing how the Rack API can be adjusted to support server native real-time connections.
The chosen proof of concept was the ugliest chatroom I could find.
Although my hope is that Rack will adopt the concept and make env['rack.websocket?']
and env['rack.websocket']
part of it's standard, at the moment it's an Iodine specific feature, implemented using env['iodine.websocket']
.
Install required gems using:
bundler install
Run this application single threaded:
bundler exec iodine -- -www ./
Or both multi-threaded and forked (you'll notice that pub/sub works across process boundaries, Redis is only required for multi-machine pub/sub).
bundler exec iodine -- -www ./ -t 16 -w 4