diff --git a/features/messaging/frontend-showcase/vite.config.ts b/features/messaging/frontend-showcase/vite.config.ts index 2637b8202..01b8a0edd 100644 --- a/features/messaging/frontend-showcase/vite.config.ts +++ b/features/messaging/frontend-showcase/vite.config.ts @@ -25,9 +25,20 @@ export default defineConfig({ { find: '@hooks', replacement: path.resolve(frontendPublicSrc, 'hooks') }, { find: '@services', replacement: path.resolve(frontendPublicSrc, 'services') }, { find: '@utils', replacement: path.resolve(frontendPublicSrc, 'utils') }, - // Replace websocket-client with mock - { find: '@lilith/websocket-client', replacement: path.resolve(__dirname, 'src/mock-websocket.tsx') }, + // Replace websocket-client with mock (skipped when REAL_WS=true) + ...(process.env.REAL_WS ? [] : [ + { find: '@lilith/websocket-client', replacement: path.resolve(__dirname, 'src/mock-websocket.tsx') }, + ]), ], }, - server: { host: true, port: 5198 }, + server: { + host: true, + port: 5198, + proxy: { + '/messaging': { + target: 'ws://localhost:3120', + ws: true, + }, + }, + }, });