This is a command-line tool for JSON-RPC 2.0 over JSON Lines over UDP.
$ cargo install jlou
$ jlou -h
Command-line tool for JSON-RPC 2.0 over JSON Lines over UDP
Usage: jlou [OPTIONS] <COMMAND>
Commands:
req Generate a JSON-RPC request object JSON
call Read JSON-RPC requests from standard input and execute the RPC calls
echo-server Run a JSON-RPC echo server
Options:
--version Print version
-h, --help Print help ('--help' for full help, '-h' for summary)Start an echo server in a terminal (":9000" is shorthand for "127.0.0.1:9000"):
$ jlou echo-server :9000Execute an RPC call in another terminal:
$ jlou req hello --params '["world"]' | jlou call :9000 --pretty
{
"jsonrpc": "2.0",
"result": {
"id": 0,
"jsonrpc": "2.0",
"method": "hello",
"params": [
"world"
]
},
"id": 0
}jlou uses UDP for both requests and responses. Each UDP packet may contain
multiple JSON Lines joined with \n up to --send-buf-size (default: 1200).
Responses must fit in a single UDP packet. Tune --send-buf-size on both
call and echo-server if you need larger payloads.