rpc-duplex-node
v0.1.4
Published
Client rpc for nodejs
Downloads
4
Readme
###rpc-duplex-node
Simple rpc for node/express
Like this..
###app.js
var express = require('express'), app = express();
var server = require('http').createServer(app)
server.listen(85);
var allin = require('./rpc-duplex-node.js')(app);
allin.log = console.log;
// Send some calls to the clients using clientcall()
function doit(){
allin.clientcall('document.getElementById("timeis").innerHTML=new Date()')
}
setInterval(doit, 1000);
app.get('/', function(r,s){
s.sendfile('index.html')
})
###index.html
<!-- include the script -->
<script src='/rpc'></script>
<div id='timeis'/>