bee
bee copied to clipboard
feat: layer2 websocket
Introducing on-demand stream messaging channels between Bee nodes so that other P2P applications can communicate between each other directly to support live services.
On GET /layer2/subscribe/{streamName} endpoint the client opens a websocket connection through which messages can pass between connected nodes (which can be managed by calling POST /connect/{multiAddress} or DELETE /peer/{address}
The PR is experimental in design and discussions are open for the feature.
send message format:
[actionType] [actionParams]
available actionTypes:
- [x] 0: unicast - send message to a node
- actionParams:
- overlay address of the target node
- message
- actionParams:
- [x] 1: broadcast - send message to all connected node
- actionParams:
- message
- actionParams:
received message format
[responseType] [responseParams]
available responseType
- [x] 0: message
- responseParams
- overlay address of the sender node
- message
- responseParams
Checklist
- [ ] I have read the coding guide.
- [ ] My change requires a documentation update, and I have done it.
- [ ] I have added tests to cover my changes.
- [ ] I have filled out the description and linked the related issues.