WebRTC-Scalable-Broadcast icon indicating copy to clipboard operation
WebRTC-Scalable-Broadcast copied to clipboard

How server works

Open oviniciuslara opened this issue 9 years ago • 1 comments

I would like someone to explain to me how the server works? I want to rewrite it in PHP because it does not know anything about nodejs ..

oviniciuslara avatar Oct 06 '15 02:10 oviniciuslara

  1. Give each user a userid or unique-token
  2. Categorize users:
    1. First user should be broadcaster
    2. Second should be receiver (at the moment) until server wanna makes him a relayer
    3. Server can make any user as a relayingPeer based on its capabilities
  3. (Assume that) a broadcaster is a relaying-peer as well.
  4. When a new user enters in the room, lookup for available relayingPeer, and return available peer's token/userid to the newcomer.

To conclude it:

  1. First user => broadcaster+relayer

    First user NEVER receives.

  2. Second user => receiver (possible relayer as well)

    Second user directly receives from broadcaster.

  3. Third user => receiver (possible relayer as well)

    Third user can receive either from broadcaster or second user.

muaz-khan avatar Mar 17 '16 08:03 muaz-khan