title: socket.io client side in node js
body: <p>Am I doing something wrong? When I run <code>node client.js</code>. I am getting this error message:</p>
  
  <pre><code>/web/ws/node_modules/socket.io/node_modules/engine.io/lib/server.js:358
    var listeners = server.listeners('request').slice(0);
                           ^
  TypeError: Object http://localhost:8080 has no method 'listeners'
      at Server.attach (/web/ws/node_modules/socket.io/node_modules/engine.io/lib/server.js:358:26)
      at Function.attach (/web/ws/node_modules/socket.io/node_modules/engine.io/lib/engine.io.js:124:10)
      at Server.listen.Server.attach (/web/ws/node_modules/socket.io/lib/index.js:226:21)
      at new Server (/web/ws/node_modules/socket.io/lib/index.js:51:17)
      at Server (/web/ws/node_modules/socket.io/lib/index.js:39:41)
      at Object.&lt;anonymous&gt; (/web/ws/client.js:2:14)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>var io = require('socket.io');
  var socket = io('ws://localhost:8080');
    socket.on('connect', function () {
      socket.send('hi');
      socket.on('message', function (msg) {
        // my msg
      });
    });
  </code></pre>
  
  <p>Please suggest something. where I am doing the mistake ?</p>