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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With