如何通过 JavaScript 的 TCP 套接字进行通信? [英] How can I communicate over TCP sockets from JavaScript?

查看:36
本文介绍了如何通过 JavaScript 的 TCP 套接字进行通信?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑 AJAX 应用程序必须轮询更新的限制,当 javascript 能够设置到服务器的真正双向连接时,这是多么理想.我想知道是否有某种方法可以将 javascript 与浏览器插件集成,可以建立 tcp 连接,以便我可以将数据传入和传出浏览器插件.

I'm thinking about how limiting it is for AJAX apps to have to poll for updates, when what would be ideal is for javascript to be able to set up a real two way connection to the server. I'm wondering if there is some method of integrating javascript with a browser plugin that can make a tcp connection so that I could pass data into and out of the browser plugin.

推荐答案

这是一个类似方法的实现:

Here is an implementation with a similar approach:

它使用 Java Applet 并将其 API 桥接到 JavaScript,有趣...

It uses a Java Applet and bridges its API to JavaScript, interesting...

这里还有一个:

这是 Actionscript 3 Socket API 的封装,桥接到 JavaScript...

This one is a wrapper of the Actionscript 3 Socket API, bridged to JavaScript...

这篇关于如何通过 JavaScript 的 TCP 套接字进行通信?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆