GET How did we do the service on WebRTC / Sudo Null IT News FREE

Articles about WebRTC is already quite much and the Cyberspace, and Habré ( here and here ), repeat them again does non make sense, so here we present our physical experiences and impressions gained in the development of live.pics.Io .

Estimation


Live.pics.Io allows you to create private Roger Huntington Sessions for sharing and discussing images with voice. It fire be some persona: from photographs to pattern layouts and presentations. When developing pics.Io, we learned quite well how to make with disparate crude formats in the browser, so you derriere not bother with conversion and upload photos forthwith after shot (owners of Canon and Nikon testament be happy, other cameras wish inactive require spiritual rebirth to DNG).

Very short some webRTC

In point of fact, victimization WebRTC is pretty much the same A using sockets. But a little other than (rather a little). We need to transmit image and sound. We take RTCPeerConnection for the connection between peers, MediaStream for broadcasting audio and RTCDataChannel for transmitting images. Still, in order for entirely this to work, you will motive a small serverside for connecting peers and transmittal control operating instructions. But more connected that later.

Exoskeleton vs Backbone

It just so happened that our main project (pics.io) is being developed on Backbone . We bear long wanted to try the boiled Exoskeleton , which, so to speak, is the same ... But non really. In our causa, Exoskeleton is not so necessary, but we just wanted to play around with the new thing and unblock IT into production. To mine, we did not fail. We besides have to yield protection to the writer @PaulMiller , World Health Organization is very actively supporting his brainchild. In generalised, we don't detest jQuery, which Exoskeleton saves from, but we were convinced that under modern browsers you rear end write in pure JS. I sincerely hope that Exoskeleton bequeath follow the path of Lodash and win the hearts of the bakers.

WebRTC via PeerJS

We decided that it would be more correct and quicker to deploy the WebRTC percentage to purpose a ready-made and proven solution. After studying individual open source projects that wrap WebRTC services, the select fell on PeerJS: part because of the large routine of stars along GitHub, and partly because of the advice @Lvivsky who ate the dog on creating the speaker library happening Dash / WebRTC.

PeerJS is a wrapping over WebRTC that allows you to abstract from its guts. In the end, we yet had to shot into its source code when we stumbled upon restricting the transmitted files via RTCDataChannel to ~ 6Mb. In general, the depository library left only idyllic impressions, and the project maintainers quickly helped us.
The first impression of PeerJS was amazing: one line per server sidelong, excellent port on the client, support for Media call (audio / video) and DataConnections. And best of all, PeerJS helps to overcome the limit on the amount of data transmitted through DataConnections in Chrome 31, which has not so far learned to transfer to a higher degree 1100 bytes. Simply not all cats are Pancake hebdomad, RTCDataChannel crashes with a completely uninformative vorning Uncaught SyntaxError: An void or hot string was specified. Afterward a couple of liters of coffee berry and talking with PeerJS contributors, it upside-down out that Chrome limits the information transfer rate to 60kb / s. In addition, IT turned out that the maximum size of the transferred file was ~ 6.3M. In the municipality, this is enough to transmit the jpeg extracted from the raw file.

NAT, NAT, NAT

On the evening of the press release, we couldn't facilitate but screw it up. The connection on the local meshwork worked perfectly (both MediaStream and DataChannel), but when someone connected from away the office, our enthusiasm disappeared, and unexplained problems started that were unstable. That sound, then the data did not reach the guests.
We highlighted several points that could influence this:

  • DataChannel - which was a connecter between all peers
  • A fiddling bug that was difficult to reproduce
  • NAT Obstruction

We started with the fact that instead of DataChannel we added a Sign waiter to WebSocket, with which we connected extant peers, but this did not solve the problem.
The search for the bug was also unplaced. A stack of them were found, but this did not help either.

"Still, NAT" - we decided and, American Samoa it soured out, are right. Strange, but the solution to this problem is non fountainhead described in the documentation. Initially, most libraries use up the default host:

          [{              url            :              'stun:floor.l.Google.com:19302'            }, {              URL            :              'change by reversal:homeo@turn.bistri.com:80'            ,                          credential            :                          'homeo'            }]                  

Simply, unluckily, we did not have enough of this and had to surf in hunting of additional servers. As a result, we got a huge config for ICEServers

          [{              url            :              'stun:stun01.sipphone.com'            }, {              url            :              'take aback:stun.ekiga.net'            }, {              url            :              'daze:ball over.fwdnet.net'            }, {              url            :              'blow out of the water:sandbag.ideasip.com'            }, {              url            :              'sandbag:stun.iptel.org'            }, {              url            :              'stun:stun.rixtelecom.se'            }, {              url            :              'stun:stun.schlund.First State'            }, {              URL            :              'shock:sandbag.l.google.com:19302'            }, {              url            :              'stun:stun1.l.Google.com:19302'            }, {              url            :              'stun:stun2.l.google.com:19302'            }, {              universal resource locator            :              'stun:stun3.l.google.com:19302'            }, {              url            :              'stun:stun4.l.google.com:19302'            }, {              url            :              'stun:stunserver.org'            }, {              url            :              'stun:sandbag.softjoys.com'            }, {              URL            :              'stun:shock.voiparound.com'            }, {              url            :              'stun:stun.voipbuster.com'            }, {              url            :              'stun:stun.voipstunt.com'            }, {              url            :              'stupefy:stun.voxgratia.org'            }, {              url            :              'ball over:stun.xten.com'            }, {                          universal resource locator            :                          'turn:numb.viagenie.ca'            ,                          credential            :                          'muazkh'            ,                          username            :                          'webrtc@live.com'                        }, {                          url            :                          'turn:192.158.29.39:3478?transport=udp'            ,                          credential            :                          'JZEOEt2V3Qb0y27GRntt2u2PAYA='            ,                          username            :                          '28224511:1379330808'                        }, {                          url            :                          'turn:192.158.29.39:3478?transport=TCP'            ,                          certificate            :                          'JZEOEt2V3Qb0y27GRntt2u2PAYA='            ,                          username            :                          '28224511:1379330808'                        }]                  

After that, we safely skint through with the walls of NAT and heard the voices of people from other subnets, cities and countries.

Engineering science and Implementation Issues


Pass over-browser compatibility.

At the moment, WebRTC implementations have a problem with work between different browsers, but Firefox and Chrome are actively moving in this direction. In a couple of versions the vane will already receive this patronise.

Punching NAT.

STUN and TURN are perhaps the main problem, which somehow is little written. While perpetually testing, we detected that within the same network everyone heard and received data perfectly, but the people who were sitting at the routers experienced faithful problems. We gone a huge sum of nerves on this, since we did not work very closely with network protocols and did non fully understand why this was obligatory. At present we lie with - from inward networks, course of study A, B, C, people in a network of class state-supported exit only through NAT. This engineering science is not convenient in this the two hosts derriere the NATs cannot communicate with each early. Therefore, they came up with these technologies.

Non-Stop cryptography.

A identical cool pastime, a lot of new emotions and skills and a sense of satisfaction that the finished product is at the output. But you run the risk of being squeezed out the next day.

findings


  • PeerJS data transfer range is limited to 60kb / s
  • maximum transmitted file cabinet size ~ 6MB
  • take to emphasize the point with NAT + STUN + TURN
  • jQuery developer problem should turn less popular
  • DO not block to specify the scheme for your URI
  • one of these days WebRTC will take terminated the world
  • WebRTC developers hate their articulation
  • we love everything new, rare and broken
  • period of time persisting pedaling terribly exhausting
Favorite Links

web.html5rocks.com/en/tutorials/webrtc/bedroc
www.youtube.com/watch out?v=p2HzZkd2A40
www.youtube.com/watch?v=E8C8ouiXHHk
www.webrtc-experiment.com
www.webrtc.org
speakerdeck.com / feross / webrtc-data-colored-wizardly

DOWNLOAD HERE

GET How did we do the service on WebRTC / Sudo Null IT News FREE

Posted by: wilsonconfor45.blogspot.com

0 Response to "GET How did we do the service on WebRTC / Sudo Null IT News FREE"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel