Skip to content

Instantly share code, notes, and snippets.

function PeerConnection(socket, localStream, token) {
this.socket = socket;
this.localStream = localStream;
this.isInitiator = token ? false : true;
this.token = token || uniqueToken();
this.callerAppId = null;
this.calleeAppId = null;
this.caller = null;
this.callee = null;
this.channel = config.appName;