title: Socket.io how to list sockets in a room by nickname
body: <p>I'm new to node.js and javascript. I'm using socket.io and trying to list sockets connected in a given room. When a socket connects I give it a nickname:</p>
  
  <pre><code>io.use(function (socket, next) {
    var handshakeUserid = socket.request._query.userid;
    socket.nickname = handshakeUserid;
    next();
  });
  </code></pre>
  
  <p>With this code I can get the id's of the sockets:</p>
  
  <pre><code> for (socketID in io.nsps['/'].adapter.rooms[room_name].sockets) {
     console.log(socketID);
   }
  </code></pre>
  
  <p>But how can I access the nickname property in this loop? Trying <code>socketID.nickname</code>, or <code>socketID[nickname]</code> will trow an error nickname is not define.</p>