aboutsummaryrefslogtreecommitdiff
path: root/webAO/client.ts
diff options
context:
space:
mode:
authorDavid Skoland <davidskoland@gmail.com>2023-11-22 18:48:59 +0100
committerDavid Skoland <davidskoland@gmail.com>2023-11-22 18:48:59 +0100
commitf848f34b9979740e85b9648eb42ecafd20dd3926 (patch)
treedd14934e32add462804fdc6615ab4774bea9413f /webAO/client.ts
parent1e56d094361f7fd4a0ad3ae0a3147120158ea6ba (diff)
Add clause for checking ws in https
Diffstat (limited to 'webAO/client.ts')
-rw-r--r--webAO/client.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/webAO/client.ts b/webAO/client.ts
index 820b7f2..c49a104 100644
--- a/webAO/client.ts
+++ b/webAO/client.ts
@@ -83,6 +83,13 @@ fpPromise
}
}
+ if (window.location.protocol === "https:" && connectionString.startsWith("ws://")) {
+ // If protocol is https: and connectionString is ws://
+ // We have a problem, since it's impossible to connect to ws:// from https://
+ // Connection will fail, but at least warn the user
+ alert('Attempted to connect using insecure websockets on https page. Please try removing s from https:// in the URL bar.')
+ }
+
client = new Client(connectionString);
client.connect()
isLowMemory();