How do I connect to a SockJS server from Node.js?
node.js, websocket
Solution
You can use `sockjs-client` from node too. Check the following packages:
- sockjs-client only XHR Streaming transport
- sockjs-client-ws only WebSocket transport
Problem
I have a SockJS server running in Node.js. Now I would like to connect to this server, not from a browser, but from another Node.js server. sockjs-client is browser only, and sockjs-node does not provide a client part. Of course I could use a module such as ws (or any other module which is RFC 6455-compliant), but then I lose all the nice functionality of the SockJS server such as fallbacks et al. How can I connect to SockJS from Node.js?