1
0
mirror of https://github.com/JustKato/FreePad.git synced 2026-02-23 07:40:46 +02:00

* Quick protocol fix client-side

This commit is contained in:
2022-06-07 01:13:45 +03:00
parent a71be11135
commit 5a8ccf20a8

View File

@@ -31,8 +31,14 @@ class PadSocket {
// Check if a connection URL was mentioned
if ( connUrl == null ) {
let connProtocol = `ws://`;
if ( window.location.protocol == `https:` ) {
connProtocol = `wss://`;
}
// 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