code: function() {
        io = io.listen(app);
        io.set("log level", 1);
        io.sockets.on("connection", function(socket) {
          connections += 1;
          console.log("   info  -".cyan, ("new connection. Connections: " + connections).yellow);
  
          socket.on("disconnect", function() {
            connections -= 1;
            console.log("   info  -".cyan, ("connection closed. Connections: " + connections).yellow);
          });
  
          socket.on("iframe-loaded", function(data) {
            urlData[data.id].counter--;
            console.log("   info  -".cyan, ("client sends event iframe-loaded").yellow, JSON.stringify(data));
          });
        });
      }
docs: Socket io initialization