从 chrome 发送 udp 数据包

Send udp packet from chrome(从 chrome 发送 udp 数据包)

本文介绍了从 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 数据包

基础教程推荐