Utility tool for load testing Colyseus.
Install the tool globally in your system.
npm install -g @colyseus/loadtest
$ colyseus-loadtest --help
Options:
--endpoint: WebSocket endpoint for all connections (default: ws://localhost:2567)
--room: room handler name
--numClients: number of connections to open
Example:
colyseus-loadtest example/bot.ts --endpoint ws://localhost:2567 --room state_handler
You may use either JavaScript or TypeScript for scripting your connections:
- See JavaScript template.
- See TypeScript template.
See below the methods that are called automatically, if implemented. (They are all optional.)
Should return a plain object containing the options for client connection i
to join the room provided as an argument.
Triggered when the client successfully joins in the room.
Triggered when the server sends a message to this client, or broadcasts to everyone.
Triggered when the room state changes in the server-side.
Triggered when the client leaves the room.
Triggered whenever an error has occurred in the room handler.
MIT.