req icon indicating copy to clipboard operation
req copied to clipboard

建议增加jsonrpc2 支持

Open it512 opened this issue 7 months ago • 0 comments

jsonrpc2 比较简单, 而且适用范围较广, lsp, mcp等协议都是基于jsonrpc2

jsonrpc2 主流的实现有2种, 1 基于tcp, 2 基于 http,本身不依赖传输层,基于http 的实现, 作为一个轻量级的rpc协议,在应用中也很适合作为grpc的备选和替代方案。

目前市面上没有较好的jsonrpc2 的client, 由于 协议本身很简单,且标准化程度,和成熟度极高, 建议 在req中直接支持

这个项目 可以作为参考实现 : https://github.com/ybbus/jsonrpc

例如: ··· golang client.R().JosnrpcCallFor(ctx context.Context, in any , out any) error client.R().JosnrpcCallRaw JosnrpcCall JosnrpcCallBatch // 这个比较复杂,如果能实现更好 ··· 其中 in和out 为指针类型

it512 avatar May 26 '25 00:05 it512