OK, being new to web sockets, and socket.io (but have been programming unix sockets for 30 years), i realise where i was going wrong.
Socket.io is not compatible with web sockets.
I installed the ws package on node.js, and changed the server side test program to this:
var WebSocketServer = require('ws').Server
, wss = new WebSocketServer({port: 8080});
wss.on('connection', function(ws) {
ws.on('message', function(message) {
console.log('received: %s', message);
});
ws.send('something');
});
And it works with the C2 web sockets.
However, web sockets suck compared with the features of socket.io and jwebsockets, so I will be developing plugins for one of those. (could not get Zacks socket.io to work).