mirror of
https://github.com/schollz/croc.git
synced 2025-10-11 13:21:00 +02:00
initiate pake
This commit is contained in:
parent
0753246a4b
commit
0b302b3f7c
2 changed files with 72 additions and 4 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue