O'Reilly logo

Sams Teach Yourself Node.js in 24 Hours by George Ornbo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required