title: Writing empty object with socket.io
body: <p>I'm currently trying to send some information via Socket.io with Node.js but it looks like I'm doing something wrong and I really don't know why.</p>
  
  <p>I have some containers on my machine using Docker and I use the Docker.io node package for my app in order to get all the information I want.</p>
  
  <p>Here's the server side function that sends the data</p>
  
  <pre><code>io.sockets.on('connection', function(socket){
     socket.emit('message',container);
  });
  
  
  var container = docker.containers.list(handler);
  
  function handler(err, res) {
  if (err) throw err;
  console.log("data returned from Docker as JS object: ", res);
  }
  </code></pre>
  
  <p>Here's the client side code that gets the socket message </p>
  
  <pre><code>var socket = io.connect('/');
  socket.on('message', function(data){
      console.log(data);
  });
  </code></pre>
  
  <p>The data that I'm sending through the socket ( the container list looks) like this:</p>
  
  <pre><code>[ { Command: 'top ',
  Created: 1393878688,
  Id: 'fa46297fa16ff184673077545437a64f2adaf62db8774be696d76cc9f52b7881',
  Image: 'ubuntu:12.04',
  Names: [ '/cranky_archimedes' ],
  Ports: [],
  Status: 'Up 20 minutes' } ]
  </code></pre>
  
  <p>But the only thing I get client side is : Object {}</p>
  
  <p>and the socket.io log is sending me this: </p>
  
  <pre><code>debug - websocket writing 5:::{"name":"message","args":[{}]}
  [ { Command: 'top ',
  Created: 1393878688,
  Id: 'fa46297fa16ff184673077545437a64f2adaf62db8774be696d76cc9f52b7881',
  Image: 'ubuntu:12.04',
  Names: [ '/cranky_archimedes' ],
  Ports: [],
  Status: 'Up 20 minutes' } ]
  </code></pre>
  
  <p>The args section is empty. I really don't know how I can put the container list JSON into that arg so it can be send proprely. Am I missing something?</p>
  
  <p>EDIT 1: </p>
  
  <p>When I log before emitting my container variable looks like this: </p>
  
  <pre><code>{ callback: [Function: handler] }
  </code></pre>