Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transferring JSON between browsers with WebRTC

I was excited by the prospect of WebRTC when I heard about it initially. It sounded like websockets but without a server. Unfortunately, all of the tutorials I have been able to find have stressed the video and and audio aspects of WebRTC. I can't find anything about sending text/data/JSON between browsers. Could you help me write a simple hello world of sorts, just sending some data from one browser to another with WebbRTC?

like image 995
Matt Avatar asked Apr 18 '12 21:04

Matt


3 Answers

This is a stab in the dark, but the latest Web API editors draft has a DataChannel interface as part of the Peer-to-Peer Data API.

However, the current Working Draft does not have this API, so possibly it is very new and as-yet unimplemented.

like image 143
Francis Avila Avatar answered Sep 29 '22 17:09

Francis Avila


DataChannel has now been implemented in Firefox (18+) and Chrome (25+), though it's still early days.

For more information see the HTML5 Rocks article Getting Started with WebRTC.

like image 42
Sam Dutton Avatar answered Sep 29 '22 17:09

Sam Dutton


This functionality is not yet implemented in any shipping WebRTC implementation. As other posters have indicated, there now is a DataChannel API in the latest WebRTC editors' draft, but the protocol for this is still being worked on. Expect to see this API live in Chrome and Firefox later this year.

like image 3
Justin Uberti Avatar answered Sep 29 '22 17:09

Justin Uberti