title: How do I get a list of connected sockets/clients with Socket.IO?
body: <p>I'm trying to get a list of all the sockets/clients that are currently connected.</p>
  <p><code>io.sockets</code> does not return an array, unfortunately.</p>
  <p>I know I could keep my own list using an array, but I don't think this is an optimal solution for two reasons:</p>
  <ol>
  <li><p>Redundancy. Socket.IO already keeps a copy of this list.</p>
  </li>
  <li><p>Socket.IO provides method to set arbitrary field values for clients (i.e: <code>socket.set('nickname', 'superman')</code>), so I'd need to keep up with these changes if I were to maintain my own list.</p>
  </li>
  </ol>
  <p>What should I do?</p>