LINXD-2222-debugging-for-i-os #7

Merged
sergiu merged 36 commits from LINXD-2222-debugging-for-i-os into master 2022-09-20 23:16:17 +00:00
Showing only changes of commit ae39a45f6d - Show all commits

40
app.js
View File

@ -3,36 +3,20 @@
*/
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;
try {
https = require('node:https');
} catch (err) {
console.log('https support is disabled!');
}
let https = require('https');;
// try {
// https = require('node:https');
// } catch (err) {
// console.log('https support is disabled!');
// }
const mediasoup = require('mediasoup');
/* Please follow mediasoup installation requirements */
/* https://mediasoup.org/documentation/v3/mediasoup/installation/ */
// import express from 'express'
// const app = express()
// const app = require('express')();
// import https from 'httpolyglot'
// import https from "https";
// import fs from 'fs'
// import path from 'path'
// 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
/**
@ -71,9 +55,9 @@ const options = {
// const io = new Server(httpsServer, { allowEIO3: true });
const httpsServer = https.createServer(options, app);
app.get('/', (req, res) => {
res.send('Now using https..');
});
httpsServer.listen(process.env.PORT, () => {
console.log('Listening on port:', process.env.PORT)
})
const io = new Server(httpsServer, {
allowRequest: (req) => {
@ -86,10 +70,6 @@ const io = new Server(httpsServer, {
// io.use(middleware);
// const httpsServer = https.createServer(options, app)
httpsServer.listen(process.env.PORT, () => {
console.log('Listening on port:', process.env.PORT)
})
// const io = new Server(httpsServer, {
// allowEIO3: true
// });