Skip to content

Commit

Permalink
Merge branch 'master' into use-vite
Browse files Browse the repository at this point in the history
  • Loading branch information
OmniTroid authored Feb 11, 2024
2 parents 3414083 + e2a80fc commit a1fa78d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions webAO/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ export function main() {
}
}

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.')
}
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('WS not supported on HTTPS. Please try removing the s from https:// at the start of the URL bar. (You might have to click inside the URL bar to see it)')
}

client = new Client(connectionString);
client.connect()
Expand Down

0 comments on commit a1fa78d

Please sign in to comment.