-
Notifications
You must be signed in to change notification settings - Fork 3
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
WIP: Dat daemon on websockets #11
Conversation
231fc54
to
f078cc6
Compare
Are there docs for how to use this? |
https://github.com/soyuka/dat-daemon#client there you go :) Lmk if you want to start an extension because I may give it a try if not! |
Awesome! I'll only have time to do anything substantial this weekend. I think a good goal for an MVP is the following:
|
There you go :D (I already digged a bit into their code).
Yes this is the hard part. For now what I suggest is to implement a simple
I'm not sure how I'd set up the |
Yeah, looks like this is where the request should be made down the socket. One thing to keep in mind is different file types. At the moment answer is a string message, maybe it should be base64 encoded data for files which will be decoded before being sent in the reply? |
Also, does your RPC protocol support multiple messages being processed at once? |
We don't need base64 imo blobs/buffers can work.
I'm not sure I got that, may you elaborate? |
I'm currently thinking of a proper implementation to introduce easy file write/read things. Other actions are fairly easy to implement as Q&A. I've come up with some channel api: Client opens a socket on if the url is of form We could also imagine a live statistics endpoint: proof of concept code:
|
@soyuka Typically when I've seen people use websockets, they maintain one persistent connection and send multiple messages down the wire. That's why I said " support multiple messages being processed", a person might have one connection and will send several commands down the wire, and will need to tie the answers back to the commands that got set. JSON-RPC handles that by attaching a message ID to each request/response. I don't think I've seen people storing actual data in websocket URLs, either, but it should work just fine. |
Related issue: #7
So far:
To do:
ws/cli.js
for instructions)