Skip to content

Commit

Permalink
reverting
Browse files Browse the repository at this point in the history
  • Loading branch information
mcfnord committed Jul 11, 2023
1 parent fcdd4b8 commit a84537a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tools/generate_json_rpc_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,39 +181,39 @@ def to_markdown(self):
items.sort(key=lambda item: item.name)

PREAMBLE = """
# Jamulus JSON-RPC Interface Documentation
# Jamulus JSON-RPC Server Documentation
<!--
This file is automatically generated from the source code.
Do not edit this file manually.
See `tools/generate_json_rpc_docs.py` for details.
-->
A JSON-RPC interface is available for both Jamulus client and server that allows programmatic access.
To add the JSON-RPC interface, run Jamulus with the `--jsonrpcport <port> --jsonrpcsecretfile /file/with/a/secret.txt` options.
This will start a JSON-RPC interface server on the specified port on the localhost.
A JSON-RPC server can be added to both Jamulus client and Jamulus server to allow programmatic access.
To add the JSON-RPC server, run Jamulus with the `--jsonrpcport <port> --jsonrpcsecretfile /file/with/a/secret.txt` options.
This will start a JSON-RPC server on the specified port on the localhost.
The file referenced by `--jsonrpcsecretfile` must contain a single line with a freely chosen string with at least 16 characters.
It can be generated like this:
```
$ openssl rand -base64 10 > /file/with/a/secret.txt
```
The JSON-RPC interface defaults to listening on the local loopback network interface (127.0.0.1).
The JSON-RPC server defaults to listening on the local loopback network interface (127.0.0.1).
This can be optionally changed by using the `--jsonrpcbindip <ip address>` command line option.
## Wire protocol
The JSON-RPC interface is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/specification) protocol, using [streaming newline-delimited JSON over TCP](https://clue.engineering/2018/introducing-reactphp-ndjson) as the transport. There are three main types of messages being exchanged:
The JSON-RPC server is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/specification) protocol, using [streaming newline-delimited JSON over TCP](https://clue.engineering/2018/introducing-reactphp-ndjson) as the transport. There are three main types of messages being exchanged:
- A **request** from the consumer to Jamulus.
- A **response** from Jamulus to the consumer.
- A **notification** from Jamulus to the consumer.
## Connect to a JSON-RPC interface
## Connect to a JSON-RPC server
On Linux, you can connect to a JSON-RPC interface using the `nc` CLI tool.
On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool.
On Windows, [you can download](https://nmap.org/ncat/) and use the `ncat` CLI tool.
Expand All @@ -230,7 +230,7 @@ def to_markdown(self):
## Example
After opening a TCP connection to the JSON-RPC interface server, the connection must be authenticated:
After opening a TCP connection to the JSON-RPC server, the connection must be authenticated:
```json
{"id":1,"jsonrpc":"2.0","method":"jamulus/apiAuth","params":{"secret": "...the secret from the file in --jsonrpcsecretfile..."}}
Expand Down

0 comments on commit a84537a

Please sign in to comment.