How to get rooms count and clients count that connect to server

I want to get the number of rooms that are created on the server, how to get that number?
Thank so much!

Hi @takaaptech,

Here's what we have at the moment:

(The issue you created on 2016 is still laying around #10)

Hi @endel !
Sorry I just a noob in js. From Server code in unity example, maybe i am using ClusterServer? How to know when we using Server or ClusterServer?

const cluster = require("cluster");
const express = require("express");

const ClusterServer = require("colyseus").ClusterServer;
const GameRoom = require('./game_room');

const PORT = process.env.PORT || 9000;
const gameServer = new ClusterServer();

// Register GameRoom as "game"
gameServer.register("game", GameRoom, {
maxClients: 2

if (cluster.isMaster) {

} else {
let app = new express();

app.get("/something", function (req, res) {

// Create HTTP Server
gameServer.attach({ server: app });


console.log("Listening on " + PORT);

In that case, can I have a static count in Room so that each time Room Create, the count variable will increment?

@takaaptech in the code you shown here you're using ClusterServer.

You can see the differences between Server and ClusterServer here:

@ahtashamabbasse this section was removed, and ClusterServer has been deprecated. The best way we have for scaling currently is:

@endel thanks, we're done with it server scalability. Next step is redis.