I wrote this as a way of learning how to muck around with websockets and node.js. There are lots of debug logs and empty methods (except for those wonderful debug logs).
I'm sharing this for educational purposes only. I don't think it's good code, but I know that it works, and I know it helped me to grok what was going on. So share and enjoy and all that.