Node.js可以在Chrome中使用其本机客户端运行客户端(即将发布) [英] Could Node.js run client side in Chrome with its native client (to be released soon)

查看:125
本文介绍了Node.js可以在Chrome中使用其本机客户端运行客户端(即将发布)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谷歌Chrome的本机客户端即将发布。 http://blog.chromium.org/2011 /02/native-client-getting-ready-for-takeoff.html
这是否允许node.js在浏览器中运行,使分布式应用程序能够相互通信,而无需通过服务器?

Google Chrome's native client is soon to be released. http://blog.chromium.org/2011/02/native-client-getting-ready-for-takeoff.html Would this allow node.js to be run within the browser enabling distributed applications to communicate with each other without having to go through the server?

推荐答案

node.js不是纯粹的Javascript代码。它的一部分用C ++编写,所以这不太可能。

node.js is not pure Javascript code. There are parts of it written in C++ so this is unlikely.

分布式通信有几种可能性。一种是使用浏览器中的Websockets api与其他浏览器进行通信。另一个是在与浏览器相同的机器上将node.js作为单独的服务器进程运行。

There are a couple of possibilities for distributed communication. One is to use the Websockets api in the browser to communicate with other browsers. The other one is to run node.js as a separate server process on the same machine as the browser.

这是构建分布式应用程序的更好选择,因为它减少对浏览器的依赖。现在,node.js的0.5.0pre版本在Cygwin上构建好,并且可以将Cygwin的基本组件捆绑为独立的二进制文件以分发给Windows客户端。 旧版本的node.js曾经以这种方式发布。

This second is a better choice for building a distributed application because it reduces dependence on the browser. Version 0.5.0pre of node.js now builds OK on Cygwin and it is possible to bundle up the essential components of Cygwin as a standalone binary to distribute to Windows clients. Older versions of node.js used to be distributed this way.

这篇关于Node.js可以在Chrome中使用其本机客户端运行客户端(即将发布)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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