           sockets.push socket
           socket.on "close", =>
             sockets.splice sockets.indexOf(socket), 1
-        
+
         stopServer = =>
           if (!stoped)
             sockets.forEach (socket) =>

    @server()

  server: ->
    app = connect()
    @middleware().forEach (middleware) ->
      app.use middleware
    if opt.https?

        @log "Error on starting server: #{err}"
      else
        @log "Server started http://#{opt.host}:#{opt.port}"

        stoped = false;
        sockets = [];

        server.on 'close', =>
          if (!stoped)
            stoped = true
