本文介绍了从浏览器中的 udp 端口​​读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了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.

另见:

这篇关于从浏览器中的 udp 端口​​读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 05:13