Creating a new server will start listening for connections, and the connection event will only be emitted after the handshake has finished. http://socket.io/ has more info on how the node api works.
wss = new Server port: 8080
wss.on 'connection', (ws) ->