From 0ee01bc3138cd04f24c291197a820bd564891c80 Mon Sep 17 00:00:00 2001 From: devbeni Date: Fri, 19 Sep 2025 19:40:18 +0200 Subject: [PATCH] fix: update Socket.IO connection to use dynamic host from environment variable --- app/event/[id]/page.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/event/[id]/page.tsx b/app/event/[id]/page.tsx index c5c315e..a01d299 100644 --- a/app/event/[id]/page.tsx +++ b/app/event/[id]/page.tsx @@ -67,7 +67,8 @@ export default function EventPage() { .then(({ io }) => { if (!mounted) return; const socketPort = process.env.NEXT_PUBLIC_SOCKET_PORT || "4000"; - const socket = io(`http://10.20.0.188:${socketPort}`, { + const socketHost = process.env.NEXT_PUBLIC_SOCKET_HOST || window.location.hostname; + const socket = io(`http://${socketHost}:${socketPort}`, { autoConnect: true }); socketRef.current = socket;