moose-team / friends-swarm

:bee: a webrtc-swarm with friends
MIT License
33 stars 6 forks source link

Peer network #6

Open callumacrae opened 7 years ago

callumacrae commented 7 years ago

Hey!

I've been thinking about how to solve the problem of a peer-to-peer group chat between a significant number of users without overloading the network: if I'm in a room with 1000 people, I don't want my browser to open 999 connections.

If I'm understanding the code correctly, does friends just open a connection to every other peer like I just described? https://github.com/moose-team/friends-swarm/blob/02bc0e186a65a5fb20b617ccd23c4614199f3039/swarm.js#L100-L120

This feels like it's going to be a super interesting problem to solve: have any of you thought about it before or know anything about the topic?

Flet commented 7 years ago

Its possible to pass maxPeers to limit the number of connections. Here is where friends does it.

maxPeers is an option exposed by webrtc-swarm.

👍

callumacrae commented 7 years ago

What happens when the number of users exceeds 20?