This commit is contained in:
bskjon 2025-02-27 18:49:02 +01:00
parent c3859b4bea
commit 078ee42f51

View File

@ -11,13 +11,20 @@ const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement document.getElementById('root') as HTMLElement
); );
const protocol = window.location.protocol;
const host = window.location.host; const wsUrl = () => {
const wsUrl = "http://localhost:8080/ws" //`${protocol}//${host}/ws`; const protocol = window.location.protocol;
const host = window.location.host;
if (window.location.href.startsWith("http://localhost:3000")) {
return "http://localhost:8080/ws";
} else {
return `${protocol}//${host}/ws`;
}
}
root.render( root.render(
<React.StrictMode> <React.StrictMode>
<Provider store={store}> <Provider store={store}>
<StompSessionProvider url={wsUrl} connectHeaders={{}} logRawCommunication={true} <StompSessionProvider url={wsUrl()} connectHeaders={{}} logRawCommunication={true}
debug={(str) => { debug={(str) => {
if (str === "Opening Web Socket...") { if (str === "Opening Web Socket...") {
} }