diff --git a/client/.env b/client/.env new file mode 100644 index 0000000..63b8c77 --- /dev/null +++ b/client/.env @@ -0,0 +1,5 @@ +# Local development environment +VITE_BASE_PATH= + +# Debug configuration +VITE_DEBUG_ENABLED=true diff --git a/client/src/contexts/SocketContext.jsx b/client/src/contexts/SocketContext.jsx index d924499..60aaafb 100644 --- a/client/src/contexts/SocketContext.jsx +++ b/client/src/contexts/SocketContext.jsx @@ -125,7 +125,7 @@ export const SocketProvider = ({ children }) => { const newSocket = io(APP_CONFIG.isProduction ? window.location.origin : 'http://localhost:3001', { - path: '/socket.io/' + path: '/ws' }); newSocket.on('connect', () => { diff --git a/nginx/conf.d/default.conf b/nginx/conf.d/default.conf index 4c287a3..0621e0e 100644 --- a/nginx/conf.d/default.conf +++ b/nginx/conf.d/default.conf @@ -95,7 +95,7 @@ server { } # Socket.IO with WebSocket support - location /socket.io/ { + location /ws { proxy_set_header X-Tenant-Subdomain $tenant; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; diff --git a/server/index.js b/server/index.js index 6b91c42..7ae715e 100644 --- a/server/index.js +++ b/server/index.js @@ -29,6 +29,7 @@ app.set('trust proxy', 1); const server = createServer(app); const io = new Server(server, { + path: '/ws', cors: { origin: [ process.env.CORS_ORIGIN || "http://localhost:3000",