eclipse-thingweb / eclipse-thingweb/node-wot
WebSocket Client
- Dominant language
- TypeScript
- Stars
- 192
- Forks
- 100
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 6
Description
I'm re-writing the software for the [OpenFlexure Microscope](https://openflexure.org/projects/microscope) which will have a Vue.js front-end and a Python/FastAPI back-end ([LabThings-FastAPI](https://github.com/rwb27/labthings-fastapi/)). Previously, we rolled our own HTTP client with `axios` but I'm keen to use an actual WoT client library this time. I've been able to get a good few things working using `node-wot` and an HTTP client, but for some things (like observing events and actions) it would be great to have a websocket client.
A quick look at the source suggests the websocket client in this library is currently a stub - is that correct, or have I missed something obvious? I will probably have a go at writing one one way or another, so I thought I'd ask here in case there's an existing effort I could join in with. @miguelrk is listed as maintainer - perhaps you could comment?
I cannot claim to be an expert node programmer, so you may or may not want a PR from me - but if I do write something, I'll see if I can format it as a PR in case it saves you effort in the future. In order to do so sensibly, is it possible there's some documentation of the websocket subprotocol you're currently using in the server part? I see that is implemented (though I've not analysed it in detail). I have mostly based my FastAPI implementation on the webthings.io subprotocol, but if there's other takes on this I would be keen to know.
If any WebSocket/HTTP long polling experts see this and want to chime in with comments like "you don't need websockets, just do long polling and the overhead is negligible" or "it's really important to minimise the number of websockets you use, so make sure you share them between components in your app" I would be very happy to take pointers!
Thanks,
Richard
Contributor guide
Assessment
This issue has not been assessed yet.