diff --git a/frontend/.env.example b/frontend/.env.example index e6a58a9..e81c748 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -3,7 +3,7 @@ CLERK_SECRET_KEY= NEXT_PUBLIC_LIVEBLOCKS_PUBLIC_KEY= LIVEBLOCKS_SECRET_KEY= -NEXT_PUBLIC_SERVER_PORT=4000 +NEXT_PUBLIC_SERVER_URL=http://localhost:4000 NEXT_PUBLIC_APP_URL=http://localhost:3000 # Set WORKER_URLs after deploying the workers. diff --git a/frontend/components/editor/index.tsx b/frontend/components/editor/index.tsx index 30c8d60..8ae8373 100644 --- a/frontend/components/editor/index.tsx +++ b/frontend/components/editor/index.tsx @@ -44,7 +44,7 @@ export default function CodeEditor({ // Initialize socket connection if it doesn't exist if (!socketRef.current) { socketRef.current = io( - `${window.location.protocol}//${window.location.hostname}:${process.env.NEXT_PUBLIC_SERVER_PORT}?userId=${userData.id}&sandboxId=${sandboxData.id}`, + `${process.env.NEXT_PUBLIC_SERVER_URL}?userId=${userData.id}&sandboxId=${sandboxData.id}`, { timeout: 2000, }