Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: devel
Fetching contributors…

Cannot retrieve contributors at this time

48 lines (33 sloc) 0.708 kb

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>
Jump to Line
Something went wrong with that request. Please try again.