My socket currently throws net::ERR_CONNECTION_REFUSED because the server isn\'t running, which I want it to do at the moment.
The problem is that the following piec
I tried creating fiddle with it and I am able to see line printed.
host='localhost'; port=100; try { ws = new WebSocket('ws://'+ host + ':' + port + '/'); } catch (err) { console.log('This never prints'); } ws.onerror = function (error) { console.log(error); };
https://jsfiddle.net/xzumgag0/