从浏览器中的 udp 端口​​读取端口、器中、udp

2023-09-07 12:32:29 作者:瞬間的愛~沒人信

除了Java Applet,还有什么我们可以从UDP 套接字读取的吗?我知道 websocket 是 TCP 套接字,但我需要通过 udp 套接字、HTML5 中的任何东西或任何东西与服务器通信?我看过这篇文章: 两年前 这篇文章同样来自 两年前没有UDP.我想知道现在我们在 2013 年是否有任何新方法可以使用浏览器通过 udp 套接字与服务器通信?

Aside from Java Applet, is there anyway we can read from an UDP socket? I know websockets are TCP sockets, but I need to communicate with a server via udp sockets, anything in HTML5, or anything at all? I have looked at this post from: two years ago and this one as well again from two years ago no UDP. I was wondering if there is any new way now that we are in 2013 to use the browser to communicate with a server via udp socket?

推荐答案

由于分布式拒绝服务 (DDOS) 攻击等安全限制,您所查找的内容无法在 Javascript 中完成.最接近客户端 JS 的可用技术(据我所知)是 WebRTC.

What you are looking for can't be done with in Javascript due to security constraints such as Distributed Denial of Service (DDOS) attacks. The closest technology available (that I know of) for client-side JS is WebRTC.

借助 WebRTC,您可以通过 SRTP 和 ICE 使用 DataChannels 作为可能的解决方案.

With WebRTC you can use DataChannels over SRTP and ICE as a possible solution.

另见:

如何使用 Web RTC 发送 UDP 数据包- Javascript?我可以使用WebRTC打开UDP连接吗?
 
精彩推荐
图片推荐