This commit is contained in:
bskjon 2025-03-18 02:01:11 +01:00
parent 39d2bbe0b3
commit 01a5d21e69

View File

@ -15,10 +15,12 @@ const root = ReactDOM.createRoot(
const wsUrl = () => {
const protocol = "ws" // window.location.protocol;
const host = window.location.host;
const wsUrl = `ws://${host}/ws`;
console.log("WsUrl", wsUrl)
if (window.location.href.startsWith("http://localhost:3000")) {
return "ws://localhost:8080/ws";
} else {
return `${protocol}//${host}/ws`;
return wsUrl;
}
}
root.render(