Channels, Topics, Sockets in websocket


I am working with Websockets for a couple of days and encountered some questions which I couldn’t find the answers in AdonisJs Documentations
I hope you help me with them :slight_smile:

  1. How to get a list of all Channels ( in server side )
  2. How to get a list of Sockets connected to a channel and topic ( in server side )

By having the answer of above questions it’s possible to iterate a channel and emit a message to all sockets of it, but if there is a simpler way :

  1. How to emit a message to a channel and topic

Thanks for your attention



Yes, there is no API to get channels lists. However you can broadcast to all sockets connected to a given topic like mentioned in the docs

What’s the use case of broadcasting across channels?