LINXD-2222: Update
This commit is contained in:
parent
177d54ec67
commit
d54403299f
11
app.js
11
app.js
@ -5,6 +5,7 @@
|
|||||||
require('dotenv').config()
|
require('dotenv').config()
|
||||||
const express = require('express');
|
const express = require('express');
|
||||||
const app = express();
|
const app = express();
|
||||||
|
const Server = require('socket.io');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
let https;
|
let https;
|
||||||
@ -68,8 +69,14 @@ const options = {
|
|||||||
|
|
||||||
// const httpsServer = https.createServer(options, app);
|
// const httpsServer = https.createServer(options, app);
|
||||||
// const io = new Server(httpsServer, { allowEIO3: true });
|
// const io = new Server(httpsServer, { allowEIO3: true });
|
||||||
const httpsServer = https.createServer(app);
|
const httpsServer = https.createServer(app, options);
|
||||||
const io = require('socket.io')(httpsServer, options);
|
const io = new Server(httpsServer, {
|
||||||
|
origins: '*:*',
|
||||||
|
allowRequest: (req) => {
|
||||||
|
console.log('req', req);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
// const io = new Server(server, { origins: '*:*', allowEIO3: true });
|
// const io = new Server(server, { origins: '*:*', allowEIO3: true });
|
||||||
|
|
||||||
// io.use(middleware);
|
// io.use(middleware);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user