In this recipe, you will build a Socket.IO server application where you will define middleware functions to restrict access to a certain namespace as well as restricting access to a certain socket based on some criteria. Before you start, create a new package.json file with the following content:
{ "dependencies": { "socket.io": "2.1.0" } }
Then, install the dependencies by opening a terminal and running:
npm install