简体   繁体   中英

How to create multi party webrtc connections, just for dataChannels?

I just want to share light weight data between mesh of rtc peers. But not able to figure out programmatically how I can create a mesh.network and create multiple dataChannels.

You need to create a new peerconnection on each user for each new user that you get. Then you will have to create data channels for each peer connection.
EX. peers AB C

  • peer A has two RTCPeerConnection one to C and one to B
  • peer B has two RTCPeerConnection one to A and one to C
  • peer C has two RTCPeerConnection one to A and one to B

ps. EACH of these CONNECTIONS have a data channel.

Alternative: A->B->C->A you connect them in a chain, which is computationally better, but it is harder to manage messages and destinations

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM