使用WebRTC在浏览器之间传输JSON [英] Transferring JSON between browsers with WebRTC

查看:70
本文介绍了使用WebRTC在浏览器之间传输JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我最初听说WebRTC时,我对它的前景感到兴奋.听起来像websocket,但没有服务器.不幸的是,我能够找到的所有教程都强调了WebRTC的视频和音频方面.我找不到有关在浏览器之间发送文本/数据/JSON的任何信息.您能帮我写一个简单的hello世界吗,只需使用WebbRTC将一些数据从一个浏览器发送到另一个浏览器?

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?

推荐答案

这是黑暗中的一个刺,但是最新的Web API编辑器草案具有 DataChannel 接口,作为对等数据API .

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.

但是,当前的工作草案没有此API,因此它可能是非常新的并且尚未实现.

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

这篇关于使用WebRTC在浏览器之间传输JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆