从 chrome 发送 udp 数据包

编程入门 行业动态 更新时间:2024-10-22 13:34:46
本文介绍了从 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:

blog.alexmaccaw/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 数据包

本文发布于:2023-11-08 15:59:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569829.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据包   chrome   udp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!