var io = require('socket.io')(strapi.server.httpServer, {
cors: {
origin: "http://localhost:3000",
methods: ["GET", "POST"],
transports: ['websocket', 'polling'],
allowedHeaders: ["my-custom-header"],
credentials: true
},
allowEIO3: true
});
This worked for me.