boardgameio / boardgame.io

State Management and Multiplayer Networking for Turn-Based Games
https://boardgame.io
MIT License
9.92k stars 704 forks source link

P2P transport #580

Open nicolodavis opened 4 years ago

nicolodavis commented 4 years ago

We should probably build a transport layer that works using WebRTC that would make it easy to host games without running a server (just share a link and anyone that joins the link is connected to the game).

What this would mean is that one player acts as a host (the master runs on their instance) and the game is valid only as long as the host is online.

visionm45 commented 4 months ago

I was thinking about something along these lines. Using holepunch (formally hypercore protocol (formally Datt)) or libp2p. I started development of an app using xmpp as the transport, but i didn't write a transport for boardgameio. How would one go about writing a transport? Is there a docs anywhere on transports or the "protocol" used or is it just pretty simple?

visionm45 commented 4 months ago

Also if this was done in this way then there would be no lobby api for creating and so would this then become part of the job of the transport or would that be a separate piece to create apart from this?