从浏览器中的udp端口读取 [英] Reading from udp port in browser
问题描述
除了Java Applet之外,我们还能从UDP套接字中读取吗?
我知道websockets是TCP套接字,但是我需要通过udp套接字,HTML5中的任何东西或任何东西与服务器通信?
我看过这篇文章:两年前以及这一篇文章再次来自两年前没有UDP 。
我想知道现在是否有任何新方法我们在2013年使用浏览器通过udp socket与服务器通信?
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,您可以使用DataChannel而不是 SRTP 和ICE作为可能的解决方案。
With WebRTC you can use DataChannels over SRTP and ICE as a possible solution.
参见:
- How to send a UDP Packet with Web RTC - Javascript?
- Can I use WebRTC to open a UDP connection?
这篇关于从浏览器中的udp端口读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!