Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor (
roomName,
doc,
{
signaling = ['wss://signaling.yjs.dev', 'wss://y-webrtc-uchplqjsol.now.sh', 'wss://y-webrtc-signaling-eu.herokuapp.com', 'wss://y-webrtc-signaling-us.herokuapp.com'],
password = null,
awareness = new awarenessProtocol.Awareness(doc)
} = {}
) {
super()
this.roomName = roomName
this.doc = doc
/**
* @type {awarenessProtocol.Awareness}
*/
this.awareness = awareness
this.shouldConnect = false
this.signalingUrls = signaling
this.signalingConns = []
/**
* @type {PromiseLike}
*/
this.key = password ? cryptoutils.deriveKey(password, roomName) : /** @type {PromiseLike} */ (promise.resolve(null))