Boilerplate

This commit is contained in:
Kai Vogelgesang
2020-04-16 17:15:17 +02:00
parent c4ffa25b33
commit e8900515bb
3 changed files with 62 additions and 37 deletions

9
static/renderer.js Normal file
View File

@@ -0,0 +1,9 @@
const ws_url = new URL('ws', window.location.href);
ws_url.protocol = ws_url.protocol.replace('http', 'ws');
const ws = new WebSocket(ws_url.href);
ws.onmessage = function(event) {
const msg = JSON.parse(event.data);
console.log(msg);
};