Book Image

Socket.IO Real-time Web Application Development

By : Rohit Rai
Book Image

Socket.IO Real-time Web Application Development

By: Rohit Rai

Overview of this book

<p>The expectations of users for interactivity withweb applications have changed over the past few years. No more does the user want to press the refresh button to check if new messages have arrived in their inbox; people expect to see updates in their applications in real-time. Mass multiplayer online games have given up the requirement of plugins and are built entirely in JavaScript. Socket.io enables you to build these highly interactive applications that work cross-browser.<br /><br />"Socket.io Real-time Web Application Development" is a guide to building, deploying, and scaling highly interactive real-time web applications using socket.io. This book will guide you through the building of a chat system using Node.js and socket.io, helping you get familiar with various features of the framework. Going further it will empower you to deploy and scale your applications in production.<br /><br />Introducing web application development with Node.js, this book walks you through developing of a full-fledged chat system built with socket.io and introducing all the concepts of socket.io and its usage in the process.<br /><br />It introduces you to the different approaches of bidirectional communication between the browser and the web server and will show you how socket.io abstracts all this for you to provide a single unified and uniform API for messaging and eventing to develop cross-browser applications. It explains how to authenticate your users, segregate the communication to channels, build chat rooms, and handle and scale sessions. It explains the mechanics behind socket.io and it also introduces you to what is involved in deploying the application to production and the intricacies involved in scaling it. <br /><br />This book will introduce you to all that is needed in browser-server communication to develop the next generation of interactive applications and games.</p>
Table of Contents (16 chapters)
Socket.IO Real-time Web Application Development
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface
Index

Node.js package manager (npm)


If you installed Node.js using the installer from the Node.js website, you will already have npm installed.

Also, if you followed the instructions to build from the source, you will probably have installed npm. If that is a yes, very good! If no, please do so now. For this, I recommend that you follow the instructions mentioned in the npm installation documentation (https://github.com/isaacs/npm/).

You can check if you have npm installed by typing the following command:

$ npm -v

This should display the version of npm installed.

For those who are wondering what npm is and why you would need a package manager for Node.js, npm is just what its name says; it provides an infrastructure in Node.js to distribute and manage packages. As I said earlier, Node.js is very modular. Node.js apps are built using many modules and third-party packages because npm provides an easy way of adding and managing third-party dependencies for our applications. We will see more on its...