Spaces:
Sleeping
Sleeping
- fix web socket
Browse files- frontend/index.html +2 -2
frontend/index.html
CHANGED
|
@@ -301,9 +301,9 @@
|
|
| 301 |
chatSending.disabled = false
|
| 302 |
chatVoice.disabled = false
|
| 303 |
}
|
| 304 |
-
ws = new WebSocket(`ws://localhost:8000/chat/${username}`);
|
| 305 |
|
| 306 |
-
|
| 307 |
|
| 308 |
musicPlayer.addEventListener("play", () => {
|
| 309 |
musicStatus = "playing"
|
|
|
|
| 301 |
chatSending.disabled = false
|
| 302 |
chatVoice.disabled = false
|
| 303 |
}
|
| 304 |
+
// ws = new WebSocket(`ws://localhost:8000/chat/${username}`);
|
| 305 |
|
| 306 |
+
ws = new WebSocket(`${location.protocol === 'https:' ? 'wss' : 'ws'}://${location.host}/chat/${username}`);
|
| 307 |
|
| 308 |
musicPlayer.addEventListener("play", () => {
|
| 309 |
musicStatus = "playing"
|