I am considering WebRTC for building a social game app which would allow 10 simultaneous connections in a mesh. I would very much love to operate my own signalling server.<p>Does anyone use WebRTC for production all setup manually than using services like tokbox or twilio? How is the performance? What mistakes would you recommend avoiding? and lastly, what tools do you use?<p>Thanks
The biggest hurdle for us was learning the ins and outs of the spec.<p>The performance for video and audio is good. I'd say it is at least as good as Skype for the most part. This is somewhat dependent on which compression you use. H.264 is usually better for mobile devices since they often have hardware accelerated encoding.<p>If you are doing a hybrid app for mobile:
Mobile support is spotty both on Android and iOS[1,2]. Android versions before 5.x use an old webview that has no support for WebRTC. This means you have to use the (abandoned) Crosswalk Project or do something with the native library. For iOS the situation is worse. Only the latest Safari 11 has support for WebRTC.<p>If building native app for mobile:
You should not have any problem with compatibility. Building WebRTC on iOS is a bit tricky the first time so make sure to check out [5].<p>If you are developing for the browser you should use adapter.js [3].<p>Building a signal server isn't that hard. But there are a lot of moving components with offer/answer and ICE candidates that needs to work before you get a connection so my tip to start off with some demo code and modify it until you have something more suited to your needs. We don't use tokbox or twilio and have built signalling server and infrastructure ourselves.<p>You will most probably need a TURN-server to handle stubborn NAT:ed networks[4]. Maybe not so much for development but it will be needed when you go to prod.<p>Also feel free to email (in profile) me if you have any other questions.<p>[1] <a href="http://caniuse.com/#search=WebRTC" rel="nofollow">http://caniuse.com/#search=WebRTC</a><p>[2] <a href="http://iswebrtcreadyyet.com/" rel="nofollow">http://iswebrtcreadyyet.com/</a><p>[3] <a href="https://github.com/webrtc/adapter" rel="nofollow">https://github.com/webrtc/adapter</a><p>[4] <a href="https://github.com/coturn/coturn" rel="nofollow">https://github.com/coturn/coturn</a><p>[5] <a href="https://medium.com/@atsakiridis/building-a-fat-webrtc-framework-on-ios-8610fffb2224#.m2s3p3zh3" rel="nofollow">https://medium.com/@atsakiridis/building-a-fat-webrtc-framew...</a>
For your use case (~10 peers) I wouldn't get bogged down with network plumbing. Use free solutions such as PeerJS, Xirsys, EasyRTC, etc. You can always open a Twilio account if you have a hit and need to scale.<p>That way you can start building immediately and get onto the hard stuff like managing global game state, handling dropped connections elegantly, network lag and prediction...<p>Good Luck ;)
<a href="https://www.sococo.com/blog/webrtc-signaling-here-be-dragons" rel="nofollow">https://www.sococo.com/blog/webrtc-signaling-here-be-dragons</a> is a good write up of the complexities here. And even with all this work, Sococo is far from perfect - we use it many times a day at my startup, and connections fail to establish all the time. Not an easy task.