Send udp packet from chrome(从 chrome 发送 udp 数据包)
问题描述
上网研究(如何发送udp到udpnode.js 服务器?,JavaScript WebSockets with UDP?)我发现无法使用 javascript 发送 udp 数据包.
Researching on the internet ( How to send udp to udp node.js server?, JavaScript WebSockets with UDP?) I have found that it is not possible to send udp packets with javascript.
另一方面,一些页面声称 chrome 浏览器能够做到这一点.例如链接:
On the other hand some pages claim that chrome browser is able to do so. For example the link:
http://blog.alexmaccaw.com/chrome-tcp-udp
声称谷歌浏览器能够发送 udp 数据包.也许我做错了什么.如果 chrome 确实可以发送 udp 数据包,如果有人可以发布 hello world 示例,我将不胜感激.我已经尝试了我显示的链接中的示例,但它不起作用.也许我做错了什么.
claims that google chrome is able to send udp packets. Maybe I am doing something wrong. If it is true that chrome can send udp packets I will appreciate if someone can post a hello world example. I have tried the example from the link I showed and it does not work. Maybe I am doing something wrong.
推荐答案
来自 链接页面一个>:
Chrome Canary 现在支持原始 TCP 和 UDP 套接字实验性"API.这些功能仅可用于扩展并且,虽然记录在案,但暂时隐藏起来.
Chrome Canary now has support for raw TCP and UDP sockets in its ‘experimental’ APIs. These features are only available for extensions and, although documented, are hidden for the moment.
所以,开发一个扩展程序,它应该可以工作.实际上,2012 年 5 月的那篇文章似乎已经过时,因为 chrome.socket
模块 现在已失去其experimental
状态.对于 HelloWorld,您可以查看他们的 udp 示例,它是从官方页面链接.
So, develop an extension and it should work. Actually, that article from May '12 seems to be outdated as the chrome.socket
module now has lost its experimental
status. For the HelloWorld, you might check out their udp sample which is linked from the official pages.
这篇关于从 chrome 发送 udp 数据包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:从 chrome 发送 udp 数据包
基础教程推荐
- 当用户滚动离开时如何暂停 youtube 嵌入 2022-01-01
- 角度Apollo设置WatchQuery结果为可用变量 2022-01-01
- 响应更改 div 大小保持纵横比 2022-01-01
- 有没有办法使用OpenLayers更改OpenStreetMap中某些要素 2022-09-06
- 悬停时滑动输入并停留几秒钟 2022-01-01
- 在 JS 中获取客户端时区(不是 GMT 偏移量) 2022-01-01
- 我什么时候应该在导入时使用方括号 2022-01-01
- 在for循环中使用setTimeout 2022-01-01
- 动态更新多个选择框 2022-01-01
- Karma-Jasmine:如何正确监视 Modal? 2022-01-01