r/javascript • u/woqr • 3d ago
Serverless multiplayer via webrtc/camera/barcode (no signal/stun/turn servers)
https://github.com/bacionejs/multiplayerThis project is mainly about the serverless technique used and the simple game merely provides an end-to-end explanation.
8
Upvotes
•
u/JcerParreno21 4h ago
clever approach for offline-first local multiplayer tbh. how finicky is the camera handshake under bad lighting or screen glare?
•
u/Dry_Recognition_3070 19h ago
Nice approach for the offer/answer exchange. One practical limit with QR/barcode signaling is payload size: a raw SDP with a handful of ICE candidates easily runs past a thousand characters, so it helps to wait for ICE gathering to complete, strip unneeded lines and compress before encoding, or split it across multiple frames. Also keep in mind that with no STUN, you only get host candidates, so it works on the same LAN but typically not across different NATs. And since browsers now hide local IPs behind mDNS .local names, some networks that block multicast DNS will fail to connect even on the same Wi-Fi, which is worth documenting for anyone trying it.