node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

rpc-socket

RPC-Socket

This is a project that I have been working on for a bit.

Install

NPM

Yeah so to install is real easy.

npm install rpc-socket

Basic usage.

Uses the server.

var Server = require('./lib/server')
 
var server = new Server({
    port : 8000
})
 
server.rpc.expose('server', {
    test : function() {
        this.send({
            hello : 'world'
        })
    }
})
 

Uses the Client.

<script src="engine.io.js"></script>
<script src="rpc-socket.js"></script>
<script>
 
    var rpc = new RpcModule()
    rpc.connect('ws://localhost:8000')
    rpc.invoke('server.test', [], console.log.bind(console))
</script>