From 01bf3b3002fbbeca557d71e1d495f09aa9899369 Mon Sep 17 00:00:00 2001 From: CoolElectronics Date: Sun, 13 Aug 2023 20:01:42 -0400 Subject: [PATCH] clean test code --- frontend/src/App.svelte | 30 ------------------------------ server/src/http.ts | 3 +-- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 0336280..1e9cde0 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -156,36 +156,6 @@ } (window as any).bare = new BareClient(); - - (window as any).a = (_) => { - let socket = bare.createWebSocket(); - - socket.onopen = function (e) { - alert("[open] Connection established"); - alert("Sending to server"); - socket.send("My name is John"); - }; - - socket.onmessage = function (event) { - alert(`[message] Data received from server: ${event.data}`); - }; - - socket.onclose = function (event) { - if (event.wasClean) { - alert( - `[close] Connection closed cleanly, code=${event.code} reason=${event.reason}` - ); - } else { - // e.g. server process killed or network down - // event.code is usually 1006 in this case - alert("[close] Connection died"); - } - }; - - socket.onerror = function (error) { - alert(`[error]`); - }; - }; {#if ready} diff --git a/server/src/http.ts b/server/src/http.ts index 5fbbf69..ca40655 100644 --- a/server/src/http.ts +++ b/server/src/http.ts @@ -34,8 +34,7 @@ export const options: BareServerOptions = { // if the remote is an IP then it didn't go through the init.lookup hook // isValid determines if this is so if (isValid(url.hostname) && parse(url.hostname).range() !== "unicast") - console.log("g"); - // throw new RangeError("Forbidden IP"); + throw new RangeError("Forbidden IP"); }, lookup: (hostname, options, callback) => lookup(hostname, options, (err: any, address: any, family: any) => {