If I were you, I would use the WebRTC library, which provides both the client and server side. Check EasyRTC , SimpleWebRTC , PeerJS or others. Most libraries are implemented in Javascript and work in Node.js.
You will find tutorials on their respective sites.
I personally use PeerJS, the code and documentation are very good and fully support data channels (useful for file transfers). The only thing is that there are only 2 founders, and the community seems pretty small.
source share