
Ask HN: Are you using WebRTC in production? - subsidd
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
======
danieka
The biggest hurdle for us was learning the ins and outs of the spec.

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.

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.

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].

If you are developing for the browser you should use adapter.js [3].

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.

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.

Also feel free to email (in profile) me if you have any other questions.

[1] [http://caniuse.com/#search=WebRTC](http://caniuse.com/#search=WebRTC)

[2] [http://iswebrtcreadyyet.com/](http://iswebrtcreadyyet.com/)

[3] [https://github.com/webrtc/adapter](https://github.com/webrtc/adapter)

[4] [https://github.com/coturn/coturn](https://github.com/coturn/coturn)

[5] [https://medium.com/@atsakiridis/building-a-fat-webrtc-
framew...](https://medium.com/@atsakiridis/building-a-fat-webrtc-framework-on-
ios-8610fffb2224#.m2s3p3zh3)

~~~
subsidd
I don't know how to thank you for such a perfectly detailed and cited answer.
This is going to help me a ton! As of now I don't have any questions as I am
just starting out, will hit you up for sure if I have any, thanks a lot again!

~~~
danieka
Glad to help and as I said if you have any further questions just shoot me an
email.

------
indescions_2017
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.

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...

Good Luck ;)

~~~
danieka
That is good advice. Not invented here is always a dangerous trap to fall in
:)

------
btown
[https://www.sococo.com/blog/webrtc-signaling-here-be-
dragons](https://www.sococo.com/blog/webrtc-signaling-here-be-dragons) 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.

