}
wsock.onmessage = (msg) => {
/* Message is offer from client */
+ /* TODO: Determine which client ?? */
console.log("Incoming connection " + msg)
/* TODO: State machine to parse offer */
}).then(() => {
const hpk = getPublicKey()
wsock.send({
- cmd: '< sdp pubKey'
- sdp: hpc.localDescription
+ cmd: '< sdp pubKey',
+ sdp: hpc.localDescription,
pubKey: hpk
})
clients.push({
- host-sdp: hpc.localDescription,
- client-sdp: hpc.remoteDescription,
+ hostsdp: hpc.localDescription,
+ clientsdp: hpc.remoteDescription,
clientPubKey: msg.pubKey
})
+
})
}
})