title: Socket.io get the namespace a socket belongs to
body: <p>Is there a way to get a sockets namespace? I've tried various things but cannot get it to work. Given a socket object I would like to be able to know what namespace it belongs to. Thank you very much.</p>
  
  <p>for example</p>
  
  <pre><code>nsp = io.of('/' + venue_code).on('connection', function(socket) {
      socket.namespace = nsp
      if (typeof servers[nsp.name] == 'undefined') {
          servers[nsp.name] = socket.id
          winston.debug("Server " + socket.id + " connected to " + nsp.name)
          socket.room = "servers"
          socket.join(socket.room)
      } else {
          socket.room = "clients"
          socket.join(socket.room)
          winston.debug("Client " + socket.id + " connected to " + nsp.name)
      }
  </code></pre>