Skip to main content
added 227 characters in body
Source Link
Philipp
  • 121.4k
  • 28
  • 261
  • 342

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.

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. I would only recommend it for large download packets, not for frame-by-frame updates.

To avoid players from spreading misinformation, you could use public/private key cryptography.

  • On login, give each player the 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 public key of the server before you trust it

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 this technique for large bulk-downloads, not for time-critical frame-by-frame updates.

To prevent players from spreading misinformation, you could use public/private key cryptography.

  • On login, give each player the server's public key directly from the server.
  • When the server sends a chunk of 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 before you trust it.
added 86 characters in body
Source Link
Philipp
  • 121.4k
  • 28
  • 261
  • 342

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. I would only recommend it for large download packets, not for frame-by-frame updates.

To avoid players from spreading misinformation, you could use public/private key cryptography.

  • On login, give each player the 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 public key of the server before you trust it

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.

To avoid players from spreading misinformation, you could use public/private key cryptography.

  • On login, give each player the 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 public key of the server before you trust it

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. I would only recommend it for large download packets, not for frame-by-frame updates.

To avoid players from spreading misinformation, you could use public/private key cryptography.

  • On login, give each player the 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 public key of the server before you trust it
Source Link
Philipp
  • 121.4k
  • 28
  • 261
  • 342

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.

To avoid players from spreading misinformation, you could use public/private key cryptography.

  • On login, give each player the 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 public key of the server before you trust it