0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

initiate pake

This commit is contained in:
Zack Scholl 2019-11-17 16:23:31 -08:00
parent 0753246a4b
commit 0b302b3f7c
2 changed files with 72 additions and 4 deletions

View file

@ -25,8 +25,20 @@
}
}
var croc = {
"pake": "",
};
var sharedPassphrase = "pass123"
console.log(sharedPassphrase)
const socketMessageListener = (event) => {
console.log(event);
if (event.data == "initiated") {
socket.send(JSON.stringify({ "m": "room", "ps": sharedPassphrase }))
} else if (event.data == "initpake") {
croc.pake = pakeInit(sharedPassphrase, "1");
socket.send(JSON.stringify({ "m": "initpake", "ps": croc.pake }))
}
};
const socketOpenListener = (event) => {
log('connected to websockets');