Use the same WebSocket client code in a browser or Node.js for isomorphic apps
github.com/gabrielgrant/javascript-universal-websocket-client
gabrielgrant/javascript-universal-websocket-client