From b73fd2c314a6a0ef636b671aaae8bc87f2c5e099 Mon Sep 17 00:00:00 2001 From: Bit-Barron Date: Thu, 31 Oct 2024 07:53:25 +0100 Subject: [PATCH] asd --- src/lib/server/socket.ts | 2 +- src/routes/(main)/dashboard/chat/[id]/+page.svelte | 2 +- vite.config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/server/socket.ts b/src/lib/server/socket.ts index 65ef493..8d3cd32 100644 --- a/src/lib/server/socket.ts +++ b/src/lib/server/socket.ts @@ -17,7 +17,7 @@ export function createSocketServer(server: HTTPServer) { methods: ['GET', 'POST'], credentials: true }, - path: '/socket.io', + path: '/api/socket.io', transports: ['websocket', 'polling'], pingTimeout: 60000, pingInterval: 25000 diff --git a/src/routes/(main)/dashboard/chat/[id]/+page.svelte b/src/routes/(main)/dashboard/chat/[id]/+page.svelte index 6d6682b..8170994 100644 --- a/src/routes/(main)/dashboard/chat/[id]/+page.svelte +++ b/src/routes/(main)/dashboard/chat/[id]/+page.svelte @@ -26,7 +26,7 @@ const socketPort = isDev ? ':3000' : ''; const socketUrl = `${window.location.protocol}//${window.location.hostname}${socketPort}`; socket = io(socketUrl, { - path: '/socket.io', + path: '/api/socket.io', transports: ['polling', 'websocket'], reconnection: true, reconnectionAttempts: 5, diff --git a/vite.config.ts b/vite.config.ts index 8b14ce6..7334320 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -7,7 +7,7 @@ export default defineConfig({ plugins: [sveltekit()], server: { proxy: { - '/socket.io': { + '/api/socket.io': { target: 'ws://localhost:3000', ws: true }