diff --git a/frontend/src/components/SocketIO.tsx b/frontend/src/components/SocketIO.tsx index 3812da8..a7169c6 100644 --- a/frontend/src/components/SocketIO.tsx +++ b/frontend/src/components/SocketIO.tsx @@ -1,8 +1,27 @@ import { io } from 'socket.io-client'; function SocketIO() { - // const socket = io("wss://server-domain.com"); - const socket = io(); // The server URL will be deduced from the window.location object. + const socket = io("ws://localhost:5001"); + socket.on('test2', (warst) => { + console.log('Test2:', warst, socket.id) + }) + socket.on("connect", () => { + console.log(socket.connected); // true + setTimeout(() => { + socket.emit('test', "warst") + socket.emit('test', "tsra") + socket.emit('test', "1234") + // socket.disconnect() + }, 1000) + }); + + socket.on("test", () => { + console.log("Got test1234"); // false + }); + + socket.on("disconnect", () => { + console.log(socket.connected); // false + }); return (
SocketIO
)