Skip to content
RPC client server setup.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.project
README.md
example.js
index.js
package.json
rpc-socket.js

README.md

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