glitchland / colyseus-monitor

Web Monitoring Panel for Colyseus

Home Page:http://colyseus.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@colyseus/monitor

Web Monitoring Panel for Colyseus

Consider backing Colyseus development and its support on Patreon.

You can use an express middleware to enable authentication on the monitor route, such as express-basic-middleware:

import * as basicAuth from "express-basic-auth";

const basicAuthMiddleware = basicAuth({
    // list of users and passwords
    users: {
        "admin": "admin",
    },
    // sends WWW-Authenticate header, which will prompt the user to fill
    // credentials in
    challenge: true
});

app.use("/colyseus", basicAuthMiddleware, monitor());

Setting custom room listing columns

app.use("/colyseus", basicAuthMiddleware, monitor({
  columns: [
    'roomId',
    'name',
    'clients',
    { metadata: "spectators" }, // display 'spectators' from metadata
    'locked',
    'elapsedTime'
  ]
}));

If unspecified, the default room listing columns are: ['roomId', 'name', 'clients', 'maxClients', 'locked', 'elapsedTime'].

Development

Install the dependencies and start the dev-server:

npm install
npm start

Access the UI on http://localhost:2567/colyseus.

Environment Variables

  • GAME_SERVER_URL (default: current URL) - the URL for colyseus monitor to monitor (example: server.game.com).

License

MIT

About

Web Monitoring Panel for Colyseus

http://colyseus.io

License:MIT License


Languages

Language:TypeScript 94.4%Language:JavaScript 4.1%Language:HTML 1.4%Language:CSS 0.2%