Add tip for connecting to JSON-RPC endpoint#3098
Add tip for connecting to JSON-RPC endpoint#3098mcfnord wants to merge 7 commits intojamulussoftware:mainfrom mcfnord:nc-ncat
Conversation
docs/JSON-RPC.md
Outdated
| - 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. |
There was a problem hiding this comment.
It might be worth add "for scripting and dianostic purposes" - as, more general use, these tools probably aren't what you'd be using. You'd probably be writing a program.
There was a problem hiding this comment.
I have added a link to a Node.js snippet.
ann0see
left a comment
There was a problem hiding this comment.
I'd be ok with it in this state too. But please still consider pljones' comment.
|
Also I'm not sure if this file gets overwritten by some Python script if new methods are added. |
|
Thanks for noticing that. So I should instead modify that script, and then run it to generate the new md file? And those two files are the new commit? This appears to be the pattern. |
docs/JSON-RPC.md
Outdated
| - 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. |
There was a problem hiding this comment.
I think something simpler for the reader than a reference to a pull request is needed. Extracting the example into a gist might be better.
There was a problem hiding this comment.
Extracting the example into a gist might be clearer.
Have we published documentation snippets to gist before? I can make one in my account, but that's not making one in this repo.
There was a problem hiding this comment.
What speaks against including it into this document?
There was a problem hiding this comment.
What speaks against including it into this document?
I wasn't sure (as I couldn't find it) how big it was.
|
|
||
| **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: | ||
|
|
||
|
|
There was a problem hiding this comment.
| <pre>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)</pre> |
There was a problem hiding this comment.
Perhaps I've reached a limit in the suggestion interface, by trying to show code there.
In any case, this doesn't go here anyway. It gets dropped into the script source. But how do I designate the code? With pre or code tags?
There was a problem hiding this comment.
None of both. You'll need to use three backticks: ` in markdown.
|
Closed as you've opened a new PR |

Discussed in #3089