Of course: just use the socket , as with any other programming language capable of network communication.
One of the servers will need to listen on the TCP port (using net.createServer ), and the other will connect to it using net.connect .
It is easy if you really only have two servers. If you have more, you will need either the main βrefereeβ, i.e. A relay (listening) server that receives messages from other servers and sends them to real recipients, or a mesh network (not a good starting point if you are new to the network).
JsonSocket seems like an interesting project for sending JSON messages using raw TCP sockets, although I have not tested it myself.
source share