For peer-to-peer communication between web browsers, WebRTC is likely the best option available. But keep in mind that it is not universally supported yet.
Also keep in mind that while you might save traffic on the server this way, the perceived performance for your clients might be far worse, because consumer-grade internet connections will likely have far worse peering than your server in a datacenter. But even when the client has a good connection, sending data to a client first and then from that client to another client will almost always have a higher latency than sending it to the other client directly. So I would only recommend itthis technique for large download packetsbulk-downloads, not for time-critical frame-by-frame updates.
To avoidprevent players from spreading misinformation, you could use public/private key cryptography.
- On login, give each player the server's public key of the server directly from the server.
- When the server sends a chunk of world data to a player, have the server sign it with their private key.
- When a client relays that chunk to another player, include the signature from the server.
- Have the receiving client validate the signature of the server with the server's public key of the server before you trust it.