We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1eced1a + 572139d commit 19c62a4Copy full SHA for 19c62a4
public/index.html
@@ -95,15 +95,17 @@
95
<script type="text/javascript" src="js/memChart.js"></script>
96
<script>
97
var myurl = location.host;
98
- var client = new WebSocket("ws://" + myurl + "/swiftmetrics-dash","swiftmetrics-dash")
+ var webSocketProtocol = "ws://"
99
+ if(location.protocol === "https:") {
100
+ webSocketProtocol = "wss://"
101
+ }
102
+ var client = new WebSocket(webSocketProtocol + myurl + "/swiftmetrics-dash","swiftmetrics-dash")
103
104
client.onmessage = function(message) {
105
received = JSON.parse(message.data);
106
topic = received.topic;
107
payload = JSON.stringify(received.payload);
108
-
- console.log(topic);
109
switch (topic) {
110
case 'cpu':
111
updateCPUData(payload);
0 commit comments