DNode:一个非常不错的基于NodeJs的JSON协议的RPC远程调用解决方案,并且还可以实现浏览器端直接调用远程服务(通过基于socket.io的websocket开发库)
安装方法:npm install dnode
npm install dnode
示例代码:
var dnode = require('dnode'); dnode.connect(5050, function (remote) { remote.zing(66, function (n) { console.log('n = ' + n); }); });