bee icon indicating copy to clipboard operation
bee copied to clipboard

feat: layer2 websocket

Open nugaon opened this issue 1 year ago • 0 comments

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
  • [x] 1: broadcast - send message to all connected node
    • actionParams:
      • message

received message format [responseType] [responseParams]

available responseType

  • [x] 0: message
    • responseParams
      • overlay address of the sender node
      • message

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.

Description

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

nugaon avatar Aug 09 '24 14:08 nugaon