Fix socket.io routing by bypassing Next.js and configuring websocket path directly

This commit is contained in:
Antigravity 2026-06-13 23:47:49 -04:00
parent 515a35c4f1
commit e0328f0260
2 changed files with 11 additions and 1 deletions

View File

@ -18,3 +18,10 @@ spec:
number: 80
path: /
pathType: Prefix
- backend:
service:
name: whatsapp-gateway
port:
number: 5001
path: /proxy/whatsapp/socket.io
pathType: Prefix

View File

@ -8,7 +8,10 @@ const path = require('path');
const app = express();
const server = http.createServer(app);
const io = new Server(server);
const io = new Server(server, {
path: '/proxy/whatsapp/socket.io',
cors: { origin: "*" }
});
const PORT = process.env.PORT || 5001;