Package socket.io-client solves the problem :-)
var socket = require('socket.io-client')('http://io.weplay.io');
socket.on('connect', function(){
console.log('Connected.');
});
socket.on('message', function(data){
console.log(data);
});
I could not solve it for several hours because of typo in the code. Uuuuf.