From 0f7b9a0675311aa679878d9e4779f269f3cb8ab4 Mon Sep 17 00:00:00 2001 From: Somnath Chattaraj Date: Sat, 12 Oct 2024 21:05:54 +0530 Subject: [PATCH] Add websocket proxy --- frontend/vercel.json | 8 +++++++- frontend/vite.config.js | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/vercel.json b/frontend/vercel.json index a5f8488..3bc060e 100644 --- a/frontend/vercel.json +++ b/frontend/vercel.json @@ -2,11 +2,17 @@ "rewrites": [ { "source": "/api/:match*", - "destination": "https://api123.campusify.site/api/:match*" + "destination": "https://chatterapi.campusify.site/api/:match*" }, { "source": "/(.*)", "destination": "/" } + ], + "proxies": [ + { + "source": "/ws/:match*", + "destination": "wss://realtime.campusify.site/:match*" + } ] } diff --git a/frontend/vite.config.js b/frontend/vite.config.js index 888612a..3b5ab69 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -17,6 +17,11 @@ export default defineConfig({ target: process.env.VITE_BACKEND_URL, changeOrigin: true, }, + "/ws": { + target: process.env.VITE_WEBSOCKET_URL, + changeOrigin: true, + ws: true, + }, }, }, });