summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2021-06-03 13:39:08 +1200
committerTom Ryder <tom@sanctum.geek.nz>2021-06-03 13:39:08 +1200
commitec727e5b90928a54e50ce6f2c342826b7cf2ab00 (patch)
treefc4301b92c660230c0fda5de7ff5ec8dd5ce3e50
parentMinor fixes on CSS (diff)
parentSupport insecure protocol for .onion services (diff)
downloadsoundboard-ec727e5b90928a54e50ce6f2c342826b7cf2ab00.tar.gz
soundboard-ec727e5b90928a54e50ce6f2c342826b7cf2ab00.zip
Merge branch 'release/v0.2.0'HEADv0.2.0master
* release/v0.2.0: Support insecure protocol for .onion services
-rw-r--r--script.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/script.js b/script.js
index 77112ab..4c9de64 100644
--- a/script.js
+++ b/script.js
@@ -22,7 +22,8 @@
var socket;
var connect = function () {
- socket = new WebSocket("wss://" + location.host + "/ws");
+ var protocol = window.location.protocol == 'https:' ? 'wss:' : 'ws:';
+ socket = new WebSocket(protocol + "//" + location.host + "/ws");
socket.onmessage = function (event) {
play(event.data);
};