true, trickle: false }) peer.on('error', function (err) { console.log('error', err) }) peer.on('signal', function (offer) { // Offer is ready to send to B, Signaling console.log('SIGNAL', JSON.stringify(offer)) }) // Accept an offer from your friend B, Signaling peer.signal(JSON.parse(bOffer)) peer.on('connect', function () { // Send the data after a connection is made peer.send('whatever' + Math.random()) }) // Receive data from B/ peer.on('data', function (data) { console.log('data: ' + data) })