1.0.2 • Published 3 years ago

koishi-plugin-rpc v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

koishi-plugin-rpc

一个为其他插件提供 RPC 的插件

Usage

安装该插件,注意需要配置 koishi 的 port 参数以使用 httpServer

Options:

plugins: {
    rpc: {
        path: '/rpc'
        // rpc 的路径,可以将此参数作为 secret 防止其他人使用 rpc 接口
    }
}

创建服务

ctx.rpc.createService(name, obj)

使用服务

const client = require('arpc/client')
(async function(){
    let obj = client('ws://127.0.0.1:8080', name)
    console.log(await obj.www)
})()

更多使用方法请参考 Anillc/arpc

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago