Gold Challenge: Separate Chat Rooms

This challenge will require you to modify both the server and client applications.

Add separate chat rooms for your users. After they enter their username, prompt them to enter the name of the chat room they would like to use.

When users are logged in to a chat room, they should only receive messages for that room over the WebSocket connection. You might need to change how you store messages on the server, how you send messages to the client, or both.

For an added challenge, show a dropdown of available chat rooms in the client UI so that users can switch from room to room. When changing to another room, make sure that any new messages are received from the server and displayed in the chat list. ...

Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.