2
0
mirror of https://github.com/ad1217/PrinterStatus synced 2024-11-24 08:23:48 -05:00

Fix websocket URI generation

This commit is contained in:
Adam Goldsmith 2020-09-10 17:52:29 -04:00
parent 746e3fcd7e
commit a852eaedd3

View File

@ -27,7 +27,7 @@ export default class App extends Vue {
mounted() {
let loc = window.location;
const ws_uri: string =
loc.protocol === 'https' ? 'wss://' : 'ws://' + loc.host + '/ws';
(loc.protocol === 'https:' ? 'wss://' : 'ws://') + loc.host + '/ws';
this.websocket = new WebSocket(ws_uri);
this.websocket.onmessage = (ev: MessageEvent) => {
const event: messages.ExtendedMessage = JSON.parse(ev.data as string);