// --- In one browser: --- const firstPeer = new RTCPeerConnection(); // ...here, first configure the media/data channels you want on the connection, then... const offer = firstPeer.createOffer(); await firstPeer.setLocalDescription(offer); sendOfferToSecondPeer(offer); // <-- How you do this signalling is up to you // --- In the other browser: --- const offer = receiveOfferFromFirstBrowser(); const secondPeer = new RTCPeerConnection(); secondPeer.setRemoteDescription(offer); const answer = secondPeer.createAnswer(); secondPeer.setLocalDescription(answer); sendAnswerBackToFirstPeer(answer); // --- Back in the first browser: --- const answer = receiveAnswerFromSecondPeer(); await firstPeer.setRemoteDescription(answer); // If all went well, both peers are now connected!