In this super simple example you will see how to use peerjs to send data from one to another.
Will create lobby and will wait for connection. If there is connection it will print data in console.
Will connect to host and send hi!
if connected.
Build with PeerJS Stable (1.4.7)
Read more: https://peerjs.com/