diff options
| author | David Skoland <davidskoland@gmail.com> | 2023-11-22 18:48:59 +0100 |
|---|---|---|
| committer | David Skoland <davidskoland@gmail.com> | 2023-11-22 18:48:59 +0100 |
| commit | f848f34b9979740e85b9648eb42ecafd20dd3926 (patch) | |
| tree | dd14934e32add462804fdc6615ab4774bea9413f | |
| parent | 1e56d094361f7fd4a0ad3ae0a3147120158ea6ba (diff) | |
Add clause for checking ws in https
| -rw-r--r-- | webAO/client.ts | 7 |
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(); |
