* Quick protocol fix client-side

This commit is contained in:
Daniel Legt 2022-06-07 01:13:45 +03:00
parent a71be11135
commit 5a8ccf20a8
1 changed files with 7 additions and 1 deletions

View File

@ -31,8 +31,14 @@ class PadSocket {
// Check if a connection URL was mentioned // Check if a connection URL was mentioned
if ( connUrl == null ) { if ( connUrl == null ) {
let connProtocol = `ws://`;
if ( window.location.protocol == `https:` ) {
connProtocol = `wss://`;
}
// Try and connect to the local websocket // Try and connect to the local websocket
connUrl = `ws://` + window.location.host + `/ws/get/${padName}`; connUrl = connProtocol + window.location.host + `/ws/get/${padName}`;
} }
// Connect to the websocket // Connect to the websocket