   # Register socket.io handlers.
   io.sockets.on 'connection', (socket) ->
     c = {}
-
     ctx = build_ctx(socket)
     ws_handlers.connection.apply(ctx, [ctx]) if ws_handlers.connection?
 

          socket.on name, (data) ->
            ctx = build_ctx(socket)
            ctx.data = data
            switch app.settings['databag']
              when 'this' then h.apply(data, [ctx])
              when 'param' then h.apply(ctx, [data])


  context.on = (obj) ->
    for name, h of obj
      if not ws_handlers[name]?
        for socket in @io.sockets.clients()
          socket.on name, (data) ->
            ctx = build_ctx(socket)
            ctx.data = data
            h = ws_handlers[name]
            h.apply(ctx, [ctx])
      ws_handlers[name] = h
  context.view = (obj) ->
