summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-11-27 19:55:13 +0100
committernea <romangraef@gmail.com>2022-11-27 19:55:13 +0100
commitee4dbe1cfc72f90eb04a6452a381723b9e4c2b7f (patch)
tree33cd61b92e3499d0b52b39f8d9d3cbce6f42626a
parent9d18011859ba5f9bb11d08de8e482496823e9963 (diff)
downloadchess-ee4dbe1cfc72f90eb04a6452a381723b9e4c2b7f.tar.gz
chess-ee4dbe1cfc72f90eb04a6452a381723b9e4c2b7f.tar.bz2
chess-ee4dbe1cfc72f90eb04a6452a381723b9e4c2b7f.zip
secure websockets
-rw-r--r--index.html3
1 files changed, 1 insertions, 2 deletions
diff --git a/index.html b/index.html
index cf54958..a3b605d 100644
--- a/index.html
+++ b/index.html
@@ -58,8 +58,7 @@
<script>
class Board {
constructor(elem) {
-
- this.socket = new WebSocket(`ws://${window.location.host}/socket`)
+ this.socket = new WebSocket(`${location.protocol.includes('s') ? 'wss' : 'ws'}://${window.location.host}/socket`)
this.exiting = false
this.boardState = {}
window.addEventListener('beforeunload', () => {