We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 362d5f1 commit 13a065aCopy full SHA for 13a065a
frontend/src/components/clock/ClockGrid.js
@@ -46,7 +46,9 @@ function ClockGrid(props) {
46
return;
47
}
48
49
- const socket = new WebSocket("ws://localhost:8080/clock/coordinates");
+ const backendUrl = process.env.REACT_APP_API_BASE || window.location.origin;
50
+ const wsProtocol = backendUrl.startsWith("https") ? "wss" : "ws";
51
+ const socket = new WebSocket(`${wsProtocol}://${new URL(backendUrl).host}/clock/coordinates`);
52
53
socket.onopen = () => {
54
socket.send(JSON.stringify({
0 commit comments