LINXD-2222-debugging-for-i-os #7
27
app.js
27
app.js
@ -8,18 +8,14 @@ import 'dotenv/config'
|
||||
/* https://mediasoup.org/documentation/v3/mediasoup/installation/ */
|
||||
import express from 'express'
|
||||
const app = express()
|
||||
// const app = require('express')();
|
||||
|
||||
import https from 'httpolyglot'
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
const __dirname = path.resolve()
|
||||
|
||||
// import Server from 'socket.io'
|
||||
import Server from 'socket.io'
|
||||
import mediasoup from 'mediasoup'
|
||||
// import * as https from "http";
|
||||
import Server from "socket.io";
|
||||
// import middleware from 'socketio-wildcard'
|
||||
// const app = express.default();
|
||||
|
||||
let worker
|
||||
/**
|
||||
@ -54,20 +50,15 @@ const options = {
|
||||
cert: fs.readFileSync('./server/ssl/cert.pem', 'utf-8')
|
||||
}
|
||||
|
||||
const httpsServer = https.createServer(options, app);
|
||||
const io = new Server(httpsServer, { allowEIO3: true });
|
||||
// const io = new Server(server, { origins: '*:*', allowEIO3: true });
|
||||
const httpsServer = https.createServer(options, app)
|
||||
|
||||
// io.use(middleware);
|
||||
// const httpsServer = https.createServer(options, app)
|
||||
httpsServer.listen(process.env.PORT, () => {
|
||||
console.log('Listening on port:', process.env.PORT)
|
||||
})
|
||||
|
||||
// httpsServer.listen(process.env.PORT, () => {
|
||||
// console.log('Listening on port:', process.env.PORT)
|
||||
// })
|
||||
|
||||
// const io = new Server(httpsServer, {
|
||||
// allowEIO3: true
|
||||
// });
|
||||
const io = new Server(httpsServer, {
|
||||
allowEIO3: true
|
||||
});
|
||||
|
||||
// socket.io namespace (could represent a room?)
|
||||
const peers = io.of('/mediasoup')
|
||||
|
Loading…
Reference in New Issue
Block a user