Compare commits
7 Commits
develop
...
fix-branch
Author | SHA1 | Date | |
---|---|---|---|
2e336a429e | |||
b14e82fd87 | |||
c4f72eddd5 | |||
6e4ceb9977 | |||
2c00de1dd0 | |||
f96fd24e03 | |||
fce2f30648 |
14
app.js
14
app.js
@ -5,12 +5,7 @@ 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!');
|
||||
}
|
||||
const https = require('https');
|
||||
const mediasoup = require('mediasoup');
|
||||
|
||||
let worker
|
||||
@ -42,8 +37,8 @@ app.use('/sfu', express.static(path.join(__dirname, 'public')))
|
||||
|
||||
// SSL cert for HTTPS access
|
||||
const options = {
|
||||
key: fs.readFileSync(process.env.SERVER_KEY, 'utf-8'),
|
||||
cert: fs.readFileSync(process.env.SERVER_CERT, 'utf-8'),
|
||||
key: fs.readFileSync('./server/ssl/key.pem', 'utf-8'),
|
||||
cert: fs.readFileSync('./server/ssl/cert.pem', 'utf-8'),
|
||||
}
|
||||
|
||||
const httpsServer = https.createServer(options, app);
|
||||
@ -63,7 +58,8 @@ httpsServer.listen(process.env.PORT, () => {
|
||||
});
|
||||
|
||||
const peers = io.of('/');
|
||||
|
||||
console.log('process.env.RTC_MIN_PORT', process.env.RTC_MIN_PORT);
|
||||
console.log('process.env.RTC_MAX_PORT', process.env.RTC_MAX_PORT, process.env.RTC_MAX_PORT.length);
|
||||
const createWorker = async () => {
|
||||
try {
|
||||
worker = await mediasoup.createWorker({
|
||||
|
Loading…
Reference in New Issue
Block a user