Initiate TCP connection from a browser (extension)?

谁说我不能喝 提交于 2020-01-16 02:05:31

问题


Is it possible to initiate a TCP connection from a browser?

If so, does there already exist browser (esp. Firefox and Chrome) extensions that do this? If no extensions exist yet, do you know the core elements/functions to create a Firefox/Chrome browser-initiated TCP connection?


回答1:


The Chrome Browser (I think since v24 in the stable channel) lets you host a TCP server, and the samples indicate that it can connect to a telnet server, which means that it is also capable of being a TCP client.

https://github.com/GoogleChrome/chrome-app-samples/tree/master/tcpserver

https://github.com/GoogleChrome/chrome-app-samples/tree/master/telnet

But these are not standardized, so, if you can work with websockets, do prefer that.

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




回答2:


There are Websockets, but they are limited to the websocket protocol outlined at in RFC 6455.

So far, most modern webbrowsers support it



来源:https://stackoverflow.com/questions/15589990/initiate-tcp-connection-from-a-browser-extension

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