diff --git a/app.js b/app.js index 9ed6227..aee3843 100644 --- a/app.js +++ b/app.js @@ -5,6 +5,7 @@ require('dotenv').config() const express = require('express'); const app = express(); +const Server = require('socket.io'); const path = require('node:path'); const fs = require('node:fs'); let https; @@ -68,8 +69,14 @@ const options = { // const httpsServer = https.createServer(options, app); // const io = new Server(httpsServer, { allowEIO3: true }); -const httpsServer = https.createServer(app); -const io = require('socket.io')(httpsServer, options); +const httpsServer = https.createServer(app, options); +const io = new Server(httpsServer, { + origins: '*:*', + allowRequest: (req) => { + console.log('req', req); + return true; + } +}); // const io = new Server(server, { origins: '*:*', allowEIO3: true }); // io.use(middleware);