This is an example from Socket.IO-node distribution adapted for PocketIO.