LINXD-2222-v2 #6
2
.env
2
.env
@ -1,3 +1,3 @@
|
||||
PORT=3001
|
||||
PORT=3000
|
||||
IP=0.0.0.0 # Listening IPv4 or IPv6.
|
||||
ANNOUNCED_IP=185.8.154.190 # Announced IPv4 or IPv6 (useful when running mediasoup behind NAT with private IP).
|
||||
|
11
app.js
11
app.js
@ -47,7 +47,9 @@ app.use('/sfu', express.static(path.join(__dirname, 'public')))
|
||||
// SSL cert for HTTPS access
|
||||
const options = {
|
||||
key: fs.readFileSync('./server/ssl/key.pem', 'utf-8'),
|
||||
cert: fs.readFileSync('./server/ssl/cert.pem', 'utf-8')
|
||||
cert: fs.readFileSync('./server/ssl/cert.pem', 'utf-8'),
|
||||
requestCert: false,
|
||||
rejectUnauthorized: false
|
||||
}
|
||||
|
||||
const httpsServer = https.createServer(options, app)
|
||||
@ -57,7 +59,12 @@ httpsServer.listen(process.env.PORT, () => {
|
||||
})
|
||||
|
||||
const io = new Server(httpsServer, {
|
||||
allowEIO3: true
|
||||
allowEIO3: true,
|
||||
origins: ["*:*"],
|
||||
allowRequest: (req, next) => {
|
||||
console.log('req', req);
|
||||
next(null, true)
|
||||
}
|
||||
});
|
||||
|
||||
// socket.io namespace (could represent a room?)
|
||||
|
Loading…
Reference in New Issue
Block a user