diff --git a/public/app.js b/public/app.js index bfb5ebd..3a6c4be 100644 --- a/public/app.js +++ b/public/app.js @@ -1,4 +1,5 @@ -const socket = new WebSocket(`ws://${window.location.host}`); +const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; +const socket = new WebSocket(`${protocol}//${window.location.host}`); socket.addEventListener('open', () => { console.log('WebSocket connection established');