LINXD-2222: Update

This commit is contained in:
Sergiu Toma 2022-09-19 17:55:21 +03:00
parent 177d54ec67
commit d54403299f
1 changed files with 9 additions and 2 deletions

11
app.js
View File

@ -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);