Underlying libraries have made breaking changes to their peer servers + I discovered a similar project that provides serverless multiplayer state management @ https://joinplayroom.com/.
Rooms is a library for serverless synchronization of state across multiple clients using WebRTC. Rooms attempts to simplify the creation of multiplayer websites. Think in terms of chatrooms, party games, collaborative whiteboarding, etc.
There are currently only two main exports: the Room
class and the useRoomState
React hook. Please check out the rest of the documentation for examples. To test out the examples, you can open those pages in a new tab or window, or invite a friend to test with.
Check out the full documentation at https://liao-frank.github.io/rooms
What is a "room"?
At a high level, a room is a group of clients that are all connected to each other through a host client. Any client can broadcast data to the other clients by sending the data through the host client.
Is Rooms really serverless?
Practically, yes. There is no server setup or configuration necessary to use Rooms. Almost all communication is client-to-client.
Technically, no. There are minimal server interactions needed for WebRTC, but these servers are cheap since most of the communication is client-to-client. Rooms is built on top of PeerJS which provides its own free servers.
Check out these MDN docs to learn more about WebRTC.