DEV Community

Discussion on: Creating Your Own Chat Room with React, Node, Socket.io and the Cloud: Part 2

Collapse
 
bradstondev profile image
Bradston Henry

Thats a great question @krishnathota .

What you want to do is investigate "Rooms" in socket.io. Here is a link to the documentation: socket.io/docs/v3/rooms/

What you may want to do is have a "lobby" area where users land on before connecting to the chat room. You can enable users to "host" chat rooms and generate a room for only the person(s) they want to chat with.

There are a few ways you could approach it but one way would be to have rooms assigned a specific id that only the host would know and then would have to share with their desired participants (think of how Zoom handles meetings).

I made a chat app with rooms and I would like to share my setup on how I did it but it may be a while before I get a change to write up the blog but it is on my list.

Hope that was helpful in some way!