Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abstractolotl/aznopoly-server
Websocket server for aznopoly
https://github.com/abstractolotl/aznopoly-server
bun typescript websocket-server
Last synced: about 21 hours ago
JSON representation
Websocket server for aznopoly
- Host: GitHub
- URL: https://github.com/abstractolotl/aznopoly-server
- Owner: Abstractolotl
- Created: 2023-11-22T10:09:49.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-04-19T06:49:36.000Z (7 months ago)
- Last Synced: 2024-04-19T07:37:39.744Z (7 months ago)
- Topics: bun, typescript, websocket-server
- Language: TypeScript
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aznopoly-server
To install dependencies:
```bash
bun install
```To run:
```bash
bun run start
```# Rooms
Server will upgrade all requests which start with /room/[a-z\d-]{6,} to a websocket request and
will subscribe the client to the desired room.
Every message sent will automatically be broadcast to room.# Packets
Room packets are prefixed with **ROOM_** and e.g. look like this:
```json
{
"type": "ROOM_WELCOME",
"data": {
"uuid": "",
"room": {}
}
}
```Client packets need to be prefixed with **CLIENT_**, or they will not be broadcast.
The Server will add a sender value to each packet which will we result in something like this:```json
{
"type": "CLIENT_MOVE",
"sender": "",
"data": {}
}
```