To do this, βone dayβ, when your chat application needs several fault-tolerant node servers, and you want to use socket.io for cross-communication between the server and the client, there is a node.js module that corresponds to the account.
https://github.com/hookio/hook.io
This is basically an event emitting a framework for cross-sharing between several "things" - such as multiple node servers.
This is relatively difficult to use compared to most modules, which is understandable, since it is a difficult task to solve.
In doing so, you will probably have to have several thousand simultaneous users and many other problems before you have problems with this.
Another thing you can do is try to develop the application in such a way that if the connection is lost (which happens all the time), for example. the server is leaving, the client has problems with the network (for example, a mobile user), etc., your application should be able to deal with this and cure such problems.
source share