I'm using Mongoose to store the chat between different registered users, at the current implementation they can retrieve chat logs if they refresh the page! which is not identical to be a real-time solution. How to use socket.io() to act as sender/receiver for many users.
I followed
https://socket.io/get-started/chat/
and
https://medium.freecodecamp.org/simple-chat-application-in-node-js-using-express-mongoose-and-socket-io-ee62d94f5804
But both, they assume the same port for the same user.