From a91dc93c6b8074abc85744716effd8eb1851c2e2 Mon Sep 17 00:00:00 2001 From: Ev Bogue Date: Sat, 6 Apr 2019 13:45:00 -0500 Subject: clean up the keygen process, and make sure we link to local websockets in repo --- app.js | 2 +- lib.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 66816c5..1869dba 100644 --- a/app.js +++ b/app.js @@ -140,7 +140,7 @@ function route () { document.getElementById("inp").addEventListener("change", readFile); } - var ws = new WebSocket('ws://bogbook.com/' + src) + var ws = new WebSocket('ws://localhost:8080/' + src) var clientLog = { publicKey: src diff --git a/lib.js b/lib.js index 572d2da..c386e5a 100644 --- a/lib.js +++ b/lib.js @@ -14,11 +14,13 @@ function getKeys () { } console.log(genkey) - if ((keys.publicKey.includes('+')) || (keys.publicKey.includes('/'))) { + + // for some reason keys with /'s in them mess up node, so we'll try generating keys again if they contain slashes + if (keys.publicKey.includes('/')) { console.log('TRYING AGAIN') setTimeout(function () { window.location.reload() - }, 100) + }, 10) } else { localStorage['id'] = JSON.stringify(keys) return keys -- cgit v1.2.3-70-g09d2