X-Git-Url: https://git.kengrimes.com/?p=henge%2Fkiak.git;a=blobdiff_plain;f=host.js;h=dd48d106ae347317d4db7b8ebebe537eed8edfde;hp=f70732b454c8f58f48664fe1e7b39096f532eca6;hb=d5073d238a4bf9fa96adabf6872a67e6b92fc832;hpb=10b1fcdf58cde8a6c6d5ebfa4bba76ef2adcf3dd diff --git a/host.js b/host.js index f70732b..dd48d10 100644 --- a/host.js +++ b/host.js @@ -9,6 +9,7 @@ if ("WebSocket" in window) { } wsock.onmessage = (msg) => { /* Message is offer from client */ + /* TODO: Determine which client ?? */ console.log("Incoming connection " + msg) /* TODO: State machine to parse offer */ @@ -23,15 +24,16 @@ if ("WebSocket" in window) { }).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 }) + }) } })