I am using simple socket.io client module to connect to web socket but the connection is failing. The way I have learned is that right after you define socket, you can access connected property to find out the status of connection and it always return false. I am trying to connect to web socket in a child process on the same server where my main process is running.
var socket = require('socket.io-client')("ws://xx.xx.xxx.xxx");
console.log(socket.connected);
socket.io-clientisn't a Websocket client. Also,socket.connectedwill only betrueafter theconnectevent has fired.socket.io-clientisn't a Websocket client, it's a SocketIO client and thus requires a SocketIO server to connect to.require('socket.io-client')('http://localhost:6001')(notws://...) If that still doesn't work, try adding some error handlers. Also, how did you start the child process?