dynamic websockets url resolve

This commit is contained in:
Zhongheng Liu 2023-12-21 19:38:01 +02:00
commit 8e99d4fa14
No known key found for this signature in database

View file

@ -3,7 +3,7 @@ import { Message } from "./Message";
import { Client, Stomp } from "@stomp/stompjs";
import { MessageType } from "./types";
import { renderToStaticMarkup } from 'react-dom/server';
const domain = "localhost"
const domain = window.location.hostname
const port = "8080"
const connectionAddress = `ws://${domain}:${port}/ws`
const ChatWrapper = (