Socket.IO works well with ExpressJS. In fact, it's possible to run an ExpressJS application and a Socket.IO server using the same port or HTTP server.
Integrating Socket.IO with ExpressJS
Getting ready
In this recipe, we will see how to integrate Socket.IO with ExpressJS. You will build an ExpressJS application that will serve an HTML file containing a Socket.IO client application. Before you start, create a new package.json file with the following content:
{ "dependencies": { "express": "4.16.3", "socket.io": "2.1.0" } }
Then, install the dependencies by opening a terminal and running:
npm install