-
Notifications
You must be signed in to change notification settings - Fork 39
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
NUT-XX: WebSocket state updates #98
base: main
Are you sure you want to change the base?
Conversation
XX.md
Outdated
All requests sent from apps to mints over Websocket MUST look like this | ||
|
||
```json | ||
["REQ", "<REQ ID>", "<COMMAND>", "<PARAMS>"] |
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.
would it make sense to use the JSON-RPC format here?
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 don't have strong opinions about this. The format is already very close to the RPC spec so I wouldn't mind. What would be the benefit of adhering to it?
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 would be the benefit of adhering to it?
I'd guess mainly existing client libraries for using JSON-RPC rather than having to write your own
This is my second take on an optional WebSocket protocol to allow bidirectional messages between clients and mints. WebSockets allow mints to push updates to clients without clients constantly polling them.
The proposal uses ids to keep track of requests, which removed the need to close and open sockets all the time and also allows for multiple request on a single socket connection.