Compare commits

2 Commits

Author SHA1 Message Date
Milan Nikolic
5fcc525cec Merge pull request #60 from tacoverflow/hotfix/use-secure-websockets-if-https-is-used
Update html.go: use wss if https is used
2025-09-17 06:01:34 +02:00
tacoverflow
1e6eae1e14 Update html.go: use wss if https is used 2025-09-16 05:22:03 -07:00

View File

@@ -45,7 +45,11 @@ var html = `<html>
<meta charset="utf-8"/>
<title>cam2ip</title>
<script>
ws = new WebSocket("ws://" + window.location.host + "/socket");
if (location.protocol === 'https:') {
ws = new WebSocket("wss://" + window.location.host + "/socket");
} else {
ws = new WebSocket("ws://" + window.location.host + "/socket");
}
var image = new Image();
ws.onopen = function() {
@@ -78,7 +82,11 @@ var htmlWebGL = `<html>
<script>
var texture, vloc, tloc, vertexBuff, textureBuff;
ws = new WebSocket("ws://" + window.location.host + "/socket");
if (location.protocol === 'https:') {
ws = new WebSocket("wss://" + window.location.host + "/socket");
} else {
ws = new WebSocket("ws://" + window.location.host + "/socket");
}
var image = new Image();
ws.onopen = function() {