From ddf584e247ae55cec8dd907baac43f3add335074 Mon Sep 17 00:00:00 2001 From: John Dempsey <1750243+mcfnord@users.noreply.github.com> Date: Sat, 8 Jul 2023 17:12:52 -0700 Subject: [PATCH 1/7] fresh attempt at https://github.com/jamulussoftware/jamulus/pull/3089/ --- docs/JSON-RPC.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/JSON-RPC.md b/docs/JSON-RPC.md index 3f82ced8b2..5f7eef572f 100644 --- a/docs/JSON-RPC.md +++ b/docs/JSON-RPC.md @@ -29,6 +29,8 @@ The JSON-RPC server is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/speci - A **response** from Jamulus to the consumer. - A **notification** from Jamulus to the consumer. +**Tip:** On Linux, you can use the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. + ## Example After opening a TCP connection to the JSON-RPC server, the connection must be authenticated: From 9c589aada8d4464be4068358a3f86baae5ceb315 Mon Sep 17 00:00:00 2001 From: John Dempsey <1750243+mcfnord@users.noreply.github.com> Date: Sat, 8 Jul 2023 17:15:25 -0700 Subject: [PATCH 2/7] Update docs/JSON-RPC.md --- docs/JSON-RPC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/JSON-RPC.md b/docs/JSON-RPC.md index 5f7eef572f..5bd0604f58 100644 --- a/docs/JSON-RPC.md +++ b/docs/JSON-RPC.md @@ -29,7 +29,7 @@ The JSON-RPC server is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/speci - A **response** from Jamulus to the consumer. - A **notification** from Jamulus to the consumer. -**Tip:** On Linux, you can use the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. +**Tip:** On Linux, you can connect to the JSON-RPC endpoint using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. ## Example From 092a10727eedbdf29c182ef000a4893fc5d4eebf Mon Sep 17 00:00:00 2001 From: John Dempsey <1750243+mcfnord@users.noreply.github.com> Date: Sat, 8 Jul 2023 17:23:51 -0700 Subject: [PATCH 3/7] Update docs/JSON-RPC.md --- docs/JSON-RPC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/JSON-RPC.md b/docs/JSON-RPC.md index 5bd0604f58..a79dd2063a 100644 --- a/docs/JSON-RPC.md +++ b/docs/JSON-RPC.md @@ -29,7 +29,7 @@ The JSON-RPC server is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/speci - A **response** from Jamulus to the consumer. - A **notification** from Jamulus to the consumer. -**Tip:** On Linux, you can connect to the JSON-RPC endpoint using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. +**Tip:** On Linux, you can connect to the JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. ## Example From ab529dfa57efe364cc1535e913529c50b5aa764f Mon Sep 17 00:00:00 2001 From: John Dempsey <1750243+mcfnord@users.noreply.github.com> Date: Sat, 8 Jul 2023 17:46:03 -0700 Subject: [PATCH 4/7] Update docs/JSON-RPC.md --- docs/JSON-RPC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/JSON-RPC.md b/docs/JSON-RPC.md index a79dd2063a..5051dc1563 100644 --- a/docs/JSON-RPC.md +++ b/docs/JSON-RPC.md @@ -29,7 +29,7 @@ The JSON-RPC server is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/speci - A **response** from Jamulus to the consumer. - A **notification** from Jamulus to the consumer. -**Tip:** On Linux, you can connect to the JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. +**Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. ## Example From 64a6c21ec2a3d742733a10158e16d751f3840025 Mon Sep 17 00:00:00 2001 From: John Dempsey <1750243+mcfnord@users.noreply.github.com> Date: Sun, 9 Jul 2023 21:41:05 -0700 Subject: [PATCH 5/7] Update docs/JSON-RPC.md --- docs/JSON-RPC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/JSON-RPC.md b/docs/JSON-RPC.md index 5051dc1563..33f6cb4508 100644 --- a/docs/JSON-RPC.md +++ b/docs/JSON-RPC.md @@ -29,7 +29,7 @@ The JSON-RPC server is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/speci - A **response** from Jamulus to the consumer. - A **notification** from Jamulus to the consumer. -**Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. +**Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. Also [see this page](https://github.com/jamulussoftware/jamulus/pull/1975) for a connection example using Node.js. ## Example From 6137e6b7c8a7294a6d29d83bd02a0d8bf337de23 Mon Sep 17 00:00:00 2001 From: John Dempsey <1750243+mcfnord@users.noreply.github.com> Date: Mon, 10 Jul 2023 11:47:08 -0700 Subject: [PATCH 6/7] Update docs/JSON-RPC.md --- docs/JSON-RPC.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/JSON-RPC.md b/docs/JSON-RPC.md index 33f6cb4508..4c192f079d 100644 --- a/docs/JSON-RPC.md +++ b/docs/JSON-RPC.md @@ -29,7 +29,8 @@ The JSON-RPC server is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/speci - A **response** from Jamulus to the consumer. - A **notification** from Jamulus to the consumer. -**Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. Also [see this page](https://github.com/jamulussoftware/jamulus/pull/1975) for a connection example using Node.js. +**Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. This snippet uses [jayson](https://www.npmjs.com/package/jayson) to connect using Node.js: + ## Example From 13fe97ea5d8b98ee543e56c7aae5c745f594adf2 Mon Sep 17 00:00:00 2001 From: John Dempsey <1750243+mcfnord@users.noreply.github.com> Date: Mon, 10 Jul 2023 11:50:08 -0700 Subject: [PATCH 7/7] Update docs/JSON-RPC.md --- docs/JSON-RPC.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/JSON-RPC.md b/docs/JSON-RPC.md index 4c192f079d..ee8480f64d 100644 --- a/docs/JSON-RPC.md +++ b/docs/JSON-RPC.md @@ -31,7 +31,12 @@ The JSON-RPC server is based on the [JSON-RPC 2.0](https://www.jsonrpc.org/speci **Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. This snippet uses [jayson](https://www.npmjs.com/package/jayson) to connect using Node.js: +
const jayson = require("jayson/promise");
+const client = new jayson.client.tcp({ host: "127.0.0.1", port: 22100 });
 
+client.request('jamulusserver/getServerInfo', {})
+.then(console.log)
+.catch(console.error)
## Example After opening a TCP connection to the JSON-RPC server, the connection must be authenticated: