title: How to debug a simulated browser client of socket.io in node.js server
body: <p>I have simulated a browser client of socket.io  in the node.js server </p>
  
  <p>I am creating the simulated browser client when particular message arrived from a Real browser client.</p>
  
  <pre><code>     console.log('creating client of '+sessionId);
      var socket=client.init();
  
      console.log(socket);
  </code></pre>
  
  <p>here is my Simulated browser client in node.js , I am using <a href="https://github.com/saschagehlich/node-socket.io-client" rel="nofollow">https://github.com/saschagehlich/node-socket.io-client</a> for creating client.</p>
  
  <pre><code>exports.init=function(){
      var socket = new io.Socket(config.host, {port: config.port, rememberTransport: false});
      // when connected, clear out display
      socket.on('connect',function() {
          console.log('dummy user connected');
      });
      socket.on('disconnect',function() {
          console.log('disconnected dummy');
      });
      socket.on('message', function(data){
        console.log(data);
      });
      socket.connect();
      return socket;
  };
  </code></pre>
  
  <p>The problem is this that the consoles in the client is not getting printed , the socket is return and printed . but not console. in client code.
  And i also want the session id of simulated client , how can i get it ?</p>