'Same socket.io connection for multiple HTML pages

I am creating an Express app that uses a Socket.io connection for real-time updates. I would like to keep the Socket.io connection even if the user switches pages.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source