| It is way more complicated than that. WebRTC is all great and shiny but there is strong obstacles to build correct data transfer applications on top of that: - You still need a server to do the "signaling" part - NAT are everywhere and will fail your p2p connections sometimes (14% of WebRTC calls according to Google, back in may) [1] - Ultimately there is a problem with JavaScript API that does not allow you to download big files seamlessly The signaling part can be solved in many ways but the server approach is the easiest and probably the most efficient/reliable one. For more informations I recommend checking an article on the infrastructure needed for WebRTC applications [2] The NAT problem is solved by ICE via STUN and TURN [3]. TURN is the ultimate fallback, it is a media relay.
TURN servers are bandwidth expensive and most of them require credentials in a way that does not fit WebRTC properly. Finally, there is the browsers problem. None of them provide a proper and standard way to give you the ability to download a stream of data coming from JavaScript (although after checking the issue, sharefest may have solved this problem, but I don't know if it works properly with firefox). There the File API in Chrome but it is not supported in Firefox. There is the blob URI but you need the whole file to create this object. This mean that your application will slow down your browser in the case of a big file sharing [4].
Ideally I wanted to see the stream API be implemented but it seems it's not going to happen, so we need something else [5]. In conclusion, no, it's not as easy as you think it is. To have a proper file sharing application you will need to address ALL of these problems.
Moreover, it's good to note that these problem are not specific to WebRTC applications. Indeed, most of these are problems we have with the Internet in general. WebRTC is just an API on top of existing solutions. I hope this answer was not too negative but informative enough :) [1] http://webrtcstats.com/first-webrtc-statistics/ [2] http://www.html5rocks.com/en/tutorials/webrtc/infrastructure... [3] https://en.wikipedia.org/wiki/Interactive_Connectivity_Estab... [4] https://github.com/Peer5/ShareFest/issues/8 [5] https://bugzilla.mozilla.org/show_bug.cgi?id=891286 EDIT: formating/typos |
STUN will get though the NAT most of the times. With the latest browsers, Firefox to Chromium is a bit dodgy, but there are workarounds. But Chromium to Chromium is perfectly fine.