fix wss
This commit is contained in:
@@ -358,7 +358,8 @@ function App() {
|
|||||||
const mainRef = useRef<HTMLDivElement>(null);
|
const mainRef = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const wsUrl = `ws://${window.location.host}/ws`;
|
const wsProtocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||||
|
const wsUrl = `${wsProtocol}//${window.location.host}/ws`;
|
||||||
let ws: WebSocket;
|
let ws: WebSocket;
|
||||||
let reconnectTimer: ReturnType<typeof setTimeout>;
|
let reconnectTimer: ReturnType<typeof setTimeout>;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user