I don't think so. Channels on the server side are a way to group sockets together for efficient data transmission. Each client acts as a socket sending and receiving data to and from the server. By grouping sockets into channels on the server, you can easily broadcast messages to multiple clients simultaneously. For example:
app.channel('authenticated').send({
warning: "Perimeter has been breached"
});
It seems like you are trying to create a chat system with multiple rooms, or channels. To achieve this, you first need to implement the ability for clients to join specific channels. This can be done by creating multiple channels on the server. You can refer to the documentation here:
In your src/channels.js file:
const { user } = connection;
if (user.room == 'yoyo') {
app.channel('yoyo').join(connection);
}
It's also a good idea to store the room information in the user object. On the client side, you can set the room when the user signs up. For example, in app.js at line 19:
await client.service('users').create(Object.assign({ room: 'yoyo' }, credentials));
You can determine which room to join from the signup form or from the URL path.