Fix WebSocket: use wss:// on HTTPS, ws:// on HTTP
Browse filesCo-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- web/index.html +2 -1
web/index.html
CHANGED
|
@@ -2891,7 +2891,8 @@ async function fetchSecondaryData() {
|
|
| 2891 |
}
|
| 2892 |
|
| 2893 |
function connectWebSocket() {
|
| 2894 |
-
const
|
|
|
|
| 2895 |
ws = new WebSocket(wsUrl);
|
| 2896 |
|
| 2897 |
ws.onopen = () => {
|
|
|
|
| 2891 |
}
|
| 2892 |
|
| 2893 |
function connectWebSocket() {
|
| 2894 |
+
const wsProto = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
| 2895 |
+
const wsUrl = `${wsProto}//${window.location.host}/ws/stream`;
|
| 2896 |
ws = new WebSocket(wsUrl);
|
| 2897 |
|
| 2898 |
ws.onopen = () => {
|