Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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": {}
}
```