Chapter 9. Adding Real-time Functionality Using Socket.io
In previous chapters, you learned how to build your MEAN application and how to create CRUD modules. These chapters covered the basic functionalities of a web application; however, more and more applications require real-time communication between the server and browser. In this chapter, you'll learn how to connect your Express and AngularJS applications in real time using the Socket.io module. Socket.io enables Node.js developers to support real-time communication using WebSockets
in modern browsers and legacy fallback protocols in older browsers. In this chapter, we'll cover the following topics:
Setting up the Socket.io module
Configuring the Express application
Setting up the Socket.io/Passport session
Wiring Socket.io routes
Using the Socket.io client object
Building a simple chat room