 
         connection.on 'message', _.bind @message, @, connection
 
-    disconnect: (cn, roomId, clientId)->
+    disconnect: (cn, clientId)->
         cn.on 'close', =>
-            delete @rooms[roomId][clientId]
-            delete @rooms[roomId] if _.isEmpty @rooms[roomId]
+            delete @connections[clientId]
 
     message: (cn, data)->
         mes = null

        host: '0.0.0.0'
        timeout: 2000

    rooms: {}

    constructor: (options) ->
        @options = _.extend {}, @options, options


        if mes.host is 'tunnel'
            switch mes.pathname
                when '/connect' then @connect cn, mes.query

        else
            @tunnelMessage cn, mes, data

    connect: (cn, q)->
        clientId = q.client or @getUID 'c'
        clientId = @getUID 'c' if @connections[clientId]

        @connections[clientId] = cn

        clearTimeout cn._startTO
        @disconnect cn, clientId
        @response cn, null, 'tunnel', '/created', client: clientId

    tunnelMessage: (cn, mes, data)->
        return if not mes.host or not @connections[mes.host]
        @connections[mes.host].send data

    response: (cn, c, h, m, q)->
        return unless h
