Hour 13. A Socket.IO Chat Server

What You’ll Learn in This Hour:

• Use Socket.IO with Express

• Add and maintain a list of nicknames

• Use callbacks with Socket.IO

• Send messages between connected users

• Create a fully featured chat server with Socket.IO

Express and Socket.IO

In Hour 12, “Introducing Socket.IO,” you were introduced to Socket.IO and how it can be used to send messages in real-time between the browser and the server. In this hour, you see a practical application of Socket.IO—a browser-based chat server. This is another excellent use case for Node.js!

The chat server has the following features:

• It allows users to set a nickname.

• It displays a list of connected users.

• It broadcasts chat messages to all connected users. ...

Get Sams Teach Yourself Node.js in 24 Hours 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.