feat: server page

This commit is contained in:
hamster1963
2024-11-23 19:28:55 +08:00
parent d1558b71c4
commit 963b6a54a6
21 changed files with 784 additions and 96 deletions

View File

@@ -19,6 +19,10 @@ export default function useWebSocket(url: string): WebSocketHook {
const connect = useCallback(() => {
if (isUnmounted.current) return;
console.log("Connecting to WebSocket...");
console.log("WebSocket URL:", url);
const ws = new WebSocket(url);
setSocket(ws);
socketRef.current = ws;