Open GauravRawat369 opened 3 months ago
if you have multiple servers then why are you hardcoding the server URL as "http://localhost:8000" while making an io connection from frontend
useEffect(() => { const _socket = io("http://localhost:8000"); _socket.on("message", onMessageRec); setSocket(_socket); return () => { _socket.off("message", onMessageRec); _socket.disconnect(); setSocket(undefined); }; }, []);
I hope someone will reply
In that case you need a reverse proxy to route your requests. Do some research, quite interesting stuff.
if you have multiple servers then why are you hardcoding the server URL as "http://localhost:8000" while making an io connection from frontend
useEffect(() => { const _socket = io("http://localhost:8000"); _socket.on("message", onMessageRec); setSocket(_socket); return () => { _socket.off("message", onMessageRec); _socket.disconnect(); setSocket(undefined); }; }, []);
I hope someone will reply