我可以使用WebRTC打开UDP连接吗? [英] Can I use WebRTC to open a UDP connection?

查看:715
本文介绍了我可以使用WebRTC打开UDP连接吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们需要使用TFTP协议将数据发送到用户的设备,TFTP协议是一种简单的类似FTP的协议,可以通过UDP工作。

We need send data to our users' devices using the TFTP protocol, which is a simple FTP-like protocol that works over UDP.

因为我们不能使用javascript打开UDP套接字,我们一直使用我们的服务器作为代理,将数据发送到我们的服务器并打开从服务器到设备的UDP连接。这确实有一个缺点,即我们的用户需要了解NAT并配置端口转发。

Since we can't open a UDP socket using javascript, we have been using our server as a proxy, sending the data to our server and opening a UDP connection from the server to the device. That does have the drawback that our users need to learn about NAT and configure port forwarding.

所以问题是,我们可以使用WebRTC打开直接UDP套接字来发送并在浏览器和设备之间接收?

So the question is, could we use WebRTC to open a direct UDP socket to send and receive between the browser and the devices?

http://www.webrtc.org/reference/webrtc-internals/vienetwork#TOC-SendUDPPacket 建议我们可以通过套接字发送一些原始的UDP数据(也就是说,如果它是可以通过javascript访问该层。我不确定),但我认为无法获取原始UDP响应。

http://www.webrtc.org/reference/webrtc-internals/vienetwork#TOC-SendUDPPacket suggests that we could send some raw UDP data over the socket (that is, if it's possible to access that layer over javascript. i'm not sure about that), but I see no way to fetch a raw UDP response.

任何帮助非常感谢

推荐答案

不。允许WebRTC发送到随机地址/端口的安全问题太多 - 我们必须确保它不能用作DDOS平台,因此我们要求目标将ICE实现为发送数据的隐式权限,我们也不允许在DataChannels中发送任意数据,只发送SRTP媒体流和数据(通过UDP + ICE上的DTLS上的SCTP)。

No. There are too many security issues allowing WebRTC to send to a random address/port - we have to make sure it doesn't work as a DDOS platform, so we require the target to implement ICE as an implicit permission to send data, and we also don't allow sending arbitrary data, just SRTP mediastreams and data in DataChannels (over SCTP over DTLS over UDP+ICE).

这篇关于我可以使用WebRTC打开UDP连接吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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