-
Notifications
You must be signed in to change notification settings - Fork 238
Add tip for connecting to JSON-RPC endpoint #3098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a link to a Node.js snippet.
ann0see
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. See https://github.com/jamulussoftware/jamulus/blob/main/tools/generate_json_rpc_docs.py |
|
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. |
|
See my comment in https://github.com/orgs/jamulussoftware/discussions/3044 |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What speaks against including it into this document?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
None of both. You'll need to use three backticks: ` in markdown.
|
Closed as you've opened a new PR |

Discussed in #3089