Skip to content

Commit 57db5f7

Browse files
authored
fix https deployments (#38)
Co-authored-by: Panos <>
1 parent d606b98 commit 57db5f7

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

static/js/socket-handlers.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
* WebSocket event handlers
33
*/
44

5-
// Initialize WebSocket connection
6-
const socket = new WebSocket('ws://' + window.location.host + '/socket.io/');
5+
// Initialize WebSocket connection with protocol detection
6+
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
7+
const socket = new WebSocket(protocol + '//' + window.location.host + '/socket.io/');
78

89
// Performance: Scroll detection to pause DOM updates during scroll
910
let isScrolling = false;

0 commit comments

Comments
 (0)