Fix socket.io routing by bypassing Next.js and configuring websocket path directly
This commit is contained in:
parent
515a35c4f1
commit
e0328f0260
|
|
@ -18,3 +18,10 @@ spec:
|
||||||
number: 80
|
number: 80
|
||||||
path: /
|
path: /
|
||||||
pathType: Prefix
|
pathType: Prefix
|
||||||
|
- backend:
|
||||||
|
service:
|
||||||
|
name: whatsapp-gateway
|
||||||
|
port:
|
||||||
|
number: 5001
|
||||||
|
path: /proxy/whatsapp/socket.io
|
||||||
|
pathType: Prefix
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,10 @@ const path = require('path');
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const server = http.createServer(app);
|
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;
|
const PORT = process.env.PORT || 5001;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue