simple-peer
simple-peer copied to clipboard
Max connection in single room
A few months ago, I have done a multiple room video chat project using peerjs. but, more than 5 users can't connect in one room. With more than 5 users, the browser stops and sometimes disconnected the server. so, I decided to convert this project using simple-peer. Now, I'm concerned about the max connection.
What is a max connection in simple-peer?
You are unlikely to see a different outcome by switching to simple-peer since the limitation you are facing is likely the hardware or network of the peers participating rather than the supporting library. As noted in the documentation , mesh networks don't scale well. That statement is not specific to simple-peer, but to WebRTC as a whole. There are solutions for this problem, but those are outside the scope of simple-peer. One such solution is to utilize an SFU (selective forwarding unit).
@smart0120 This blog post may be of some help in understanding your options.
@jarretttaylor Thanks for your help. I'll check this and let you know
Hello @jarretttaylor Thanks again for your help. I checked this doc and others related SFC. and I found 5 top opensource for SFC in this blog What do you recommend? and Could you please help me to set up SFU server? Looking forward to discussing more.
@smart0120 Unfortunately, I will not be of much help on this. I have neither set up nor utilized an SFU as my WebRTC projects have not needed to support more than a couple of users in a "room" at a time.
Thanks anyway I'd like to discuss other problems in webrtc
I have a prototype app which uses simple-peer and mimics an SFU / MCU using a web browser, where all of the participants connect to that browser over P2P, not requiring a mesh connection to the other peers.
Apple M1 processors running Google Chrome seem to be the best as the network host, but I've had good experience with running old Android devices as the host and running high resolution video streams to multiple peers.
I don't think the M1 would handle 50 concurrent video connections, but it might handle 50 audio-only connections. I'm working on breaking the app apart to make the network hosting available as a library.
https://speaker.app/setup/network/create https://github.com/zenOSmosis/speaker.app
Thanks for your kindly help
In my project, I also used express, mongo, socket.io, and peerjs (I'm going to use simple-peer) but, for now, I can't figure out how can you set up SFU / MCU and how can I replicate it for my project
could you please help me more?
You may want to check out https://mediasoup.org, or any of these other open-source projects: https://ourcodeworld.com/articles/read/1212/top-5-best-open-source-webrtc-media-server-projects
I have no experience setting up simple-peer with a traditional SFU / MCU and don't think it's really designed for that purpose.
Keep in mind, depending on how much you need to scale your users, you will need to scale your backend accordingly to handle all of the connections.
If it's a business requirement instead of a personal one, you might want to use something like twilio-video instead: https://www.npmjs.com/package/twilio-video
Could you please check the attached file first?
I've scanned it out of curiosity, and am not on Skype.
Hello @jzombie
I had a problem - Connection issue on Chrome on Mac
User A uses Google Chrome on Windows User B uses Google Chrome on Mac
When A walks up to B - video/audio doesn't connect. When B walks up to A - video/audio connects.
so, my questions are:
- how can fix it?
- Is this error only related peerjs? so will it be fixed. If I use simple-peer instead of peerjs?
I'd assume the issue is just related to peerjs. Probably just want to try to use simple-peer instead of peerjs and see if that fixes the problem. Sorry, I don't really have any other information to offer you other than that.
thanks for your response