How to create sockets in google chrome extension?

折月煮酒 提交于 2021-02-06 03:16:17

问题


I created small hello world extension for google chrome http://code.google.com/chrome/extensions/getstarted.html. I need to use sockets in extension for peer to peer communication using UDP. Is there any firefox Jslib equivalent in google chrome or how we can use other languages in google chrome extension?

I doubt its possible in google chrome, looking at its documentation. ? Are there any other ways to achieve p2p communication in extension?


回答1:


Chrome has an packaged app support for raw socket connections. More general info here. This used to be available to extensions as well but it's not clear if that's still true.

The documentation indicates that only UDP is available for the type when the socket is created. However, recently (Jan 2012) there was a commit adding TCP support.




回答2:


These are not websockets (it's TCP or UDP sockets):

http://developer.chrome.com/apps/socket.html

https://developers.google.com/live/shows/7320022-5001

The second link is a howto for making a web-server in a Chrome app.



来源:https://stackoverflow.com/questions/1535752/how-to-create-sockets-in-google-chrome-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!