From 276f0c63dd59ee2deb46dc09d568c36eb9f7b063 Mon Sep 17 00:00:00 2001 From: Kilton937342 Date: Sat, 2 Jul 2022 17:48:50 +0200 Subject: [PATCH] corrections --- frontend/.env | 4 ++-- frontend/components/room/RoomPage.jsx | 1 + frontend/context/websocket.context.js | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/frontend/.env b/frontend/.env index caa045b8..c800ab0c 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1,3 +1,3 @@ NEXT_PUBLIC_HOSTNAME=192.168.1.18 -PORT=8000 -NEXT_PUBLIC_HOST=http://$NEXT_PUBLIC_HOSTNAME:$PORT \ No newline at end of file +NEXT_PUBLIC_PORT=8000 +NEXT_PUBLIC_HOST=http://$NEXT_PUBLIC_HOSTNAME:$NEXT_PUBLIC_PORT \ No newline at end of file diff --git a/frontend/components/room/RoomPage.jsx b/frontend/components/room/RoomPage.jsx index 70f06fbb..304c8477 100644 --- a/frontend/components/room/RoomPage.jsx +++ b/frontend/components/room/RoomPage.jsx @@ -30,6 +30,7 @@ export default function RoomPage({ id_code, user }) { useEffect(() => { if (isConnected == false && isBrowser) { + console.log('CONNECTED') connect("/ws/room/" + id_code); send({ data: { diff --git a/frontend/context/websocket.context.js b/frontend/context/websocket.context.js index b3c2e64c..a32cff88 100644 --- a/frontend/context/websocket.context.js +++ b/frontend/context/websocket.context.js @@ -16,9 +16,11 @@ export const WebsocketProvider = ({ children }) => { if (isBrowser) { var url = url.startsWith('/')? url: '/' + url - + console.log( + `ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}` + ); ws.current = new ReconnectingWebSocket( - `ws://${process.env.NEXT_PUBLIC_HOST}:${process.env.NEXT_PUBLIC_PORT}${url}` + `ws://${process.env.NEXT_PUBLIC_HOSTNAME}:${process.env.NEXT_PUBLIC_PORT}${url}` ); ws.current.onopen = () => {