# room-rs ENV: ``` PASS=pass ./target/debug/room-rs ``` Slash commands: * /exit - close current websocket * /statistic - show statistics\[admin] * /pass <pass> - set pass * /rooms - show rooms\[admin] * /room <room id> - show room clients\[admin] * /version - show version\[admin] * /time - show time # Message format Enter room: ```json { "type": "Enter", "roomId": "", "clientId": "" } ``` or ``` .enter room-id: client-id: ``` Exit room: ```json { "type": "Exit" } ``` or ``` .exit ``` Destroy room: ```json { "type": "Destroy" } ``` or ``` .destroy ``` List room peers: ```json { "type": "ListPeers" } ``` or ``` .list-peers ``` Broadcast room message: ```json { "type": "Broadcast", "data": "" } ``` or ``` .broadcast data: ``` Send room peer message: ```json { "type": "Peer", "peerId": "", "data": "" } ``` or ``` .peer peer-id: data: ``` Test with command line: > WebSocket cat: https://www.npmjs.com/package/wscat Install `wscat` with `npm`: ```shell npm install -g wscat ```