Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
peter ed3da909c6 push il y a 4 ans
src doc il y a 4 ans
test test checkin docs il y a 4 ans
.drone.yml push il y a 4 ans
.gitignore automate documentation il y a 4 ans
.npmignore fix il y a 4 ans
README.md push il y a 4 ans
package-lock.json test checkin docs il y a 4 ans
package.json hide breadcrumbs il y a 4 ans
tsconfig.json werks il y a 4 ans

README.md

About

rpclibrary is a websocket on steroids!

How to install

npm i rpclibrary

Quickstart

import {Backend, Frontend} from 'rpclibrary'

const echo = (x) => x

const server = new Backend.RPCServer(20000, [{
    name: 'HelloWorldRPCGroup',
    exportRPCs: ()  => [
        echo,
        function echof(x){ return x },
        {
            name: 'echoExplicit',
            call: async (x) => x
        }
    ]
}])

const client = new Frontend.RPCSocket(20000, 'localhost')

client.connect().then(async () => {
    const r0 = await client['HelloWorldRPCGroup'].echo('Hello')
    const r1 = await client['HelloWorldRPCGroup'].echof('World')
    const r2 = await client['HelloWorldRPCGroup'].echoExplicit('RPC!')

    console.log(r0,r1,r2)
})

Documentation

[https://gitea.frontblock.me/fw-docs/rpclibrary]