Great stuff.
Just for sake of completeness, you can basically copy-paste that code into Ruby as well via em-websocket: http://github.com/igrigorik/em-websocket
Also, to avoid some of the callback muck that a few have brought up: http://github.com/igrigorik/em-synchrony
(same idea, closures + coroutines to abstract the callbacks).