Skip to content

sile/jlou

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jlou

jlou Actions Status License

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)

Examples

Basic RPC call

Start an echo server in a terminal (":9000" is shorthand for "127.0.0.1:9000"):

$ jlou echo-server :9000

Execute 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
}

UDP

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.

About

Command-line tool for JSON-RPC 2.0 over JSON Lines over UDP

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages