Compare commits
179 Commits
LINXD-2180
...
develop
Author | SHA1 | Date | |
---|---|---|---|
ce1fe3ca8d | |||
96b770d9c5 | |||
4b1f4fab70 | |||
ba7c2186af | |||
636e8a9fab | |||
5da2eb6927 | |||
97948a5d8c | |||
b94b1bff86 | |||
5c4f2bf13e | |||
df7f1987f6 | |||
7842953faf | |||
4591617b1e | |||
9b3f2f94c8 | |||
29a4cd7227 | |||
c80265fe25 | |||
abb1533c9b | |||
6e3ce9fbb3 | |||
4d8adf9eac | |||
bde02fe250 | |||
0ddb43b4b5 | |||
f02d6af726 | |||
7ee93d7963 | |||
98212a78cb | |||
33ea44ac02 | |||
6b822142d0 | |||
50e95b93a4 | |||
6eca0808c9 | |||
f728b23b7f | |||
33c0234fb0 | |||
f81d5b2dfa | |||
ae87b5bd71 | |||
09e82fb224 | |||
1da0170261 | |||
aca0a6eac0 | |||
23ca56c8c6 | |||
a2d0b6771b | |||
9382fd11fb | |||
fb99fd57f8 | |||
0f4342777a | |||
69c167e4e9 | |||
ad4c1f27e7 | |||
b2128c4754 | |||
af53dc1610 | |||
f48fe4f9aa | |||
6fd6ca9755 | |||
1b72941a32 | |||
c037240f47 | |||
9716bddd71 | |||
e6c08a2c1d | |||
1342e812e6 | |||
d8405eccc7 | |||
5bf31d452f | |||
c034610471 | |||
df5b3eab90 | |||
b0293230b6 | |||
391e8eb6f0 | |||
3139a625a2 | |||
48eee903a5 | |||
d5bc0cd1d3 | |||
1c353d7c88 | |||
9d43b7ec0c | |||
342d09c3e6 | |||
b3409de3ba | |||
3e31ba21bd | |||
cdf02756d3 | |||
b2f9f5affa | |||
5b9bfeaa01 | |||
e3bef9b3e5 | |||
8a9c370f02 | |||
652019b07d | |||
09c4a4b90e | |||
75d0e3aee7 | |||
30ac997634 | |||
5aea138f6a | |||
5b01ddc2a8 | |||
084ff36ebe | |||
f4ebf92783 | |||
b59a157b18 | |||
9f8347bec5 | |||
24390c98e5 | |||
1a7371fe18 | |||
be5f97762a | |||
03a11126c4 | |||
fafbee6e4c | |||
bbf23c33d4 | |||
5c2808e75a | |||
2aea7497cc | |||
56835d6660 | |||
fc42c79210 | |||
d81bc8582d | |||
a4d16998cd | |||
de1458bbde | |||
b0fad5f1db | |||
eb5aa12d65 | |||
52b4794a86 | |||
5f8f2ab44c | |||
55455be8e7 | |||
62a82dc3a5 | |||
ac078e72ff | |||
be396e1047 | |||
149876fc70 | |||
adbeb2071b | |||
a6681ffe40 | |||
efc9bfd114 | |||
a8afa8a532 | |||
507c131058 | |||
043f66eb0c | |||
cb5716dd5c | |||
ae39a45f6d | |||
0ec5769ee0 | |||
72ee3e43ab | |||
f20c7fada8 | |||
53a654c50f | |||
d54403299f | |||
177d54ec67 | |||
649c7a3767 | |||
08d6ccbb21 | |||
fd005351b5 | |||
fc111540d8 | |||
c4f4be0aa8 | |||
40c03592df | |||
a59cbcf8cc | |||
7cc3a95b38 | |||
05e3d997f1 | |||
9c731f4085 | |||
f6d862966e | |||
05ccd5cfd4 | |||
43eee11c7e | |||
0033cd528d | |||
5022d88b1d | |||
52b922825f | |||
07be8af9ae | |||
29737fe5d8 | |||
1f5755b72d | |||
a2c878f91c | |||
7b6f78725b | |||
41c6ad281d | |||
f5406f163f | |||
28497fda91 | |||
4a98a79630 | |||
22e8b4d364 | |||
575dbd69b0 | |||
a51a757d17 | |||
c059dd5afc | |||
19808da24e | |||
2f6c25c171 | |||
ead0069aa8 | |||
434c8f744c | |||
7198dc91b1 | |||
f629012712 | |||
41b50d2a11 | |||
b85ba68c9c | |||
|
6acd276324 | ||
|
294dbdf38d | ||
|
c3d50fdc4e | ||
|
c12ececf47 | ||
|
47eb302f5f | ||
|
accf960aa7 | ||
|
ab685270f1 | ||
|
6938e751fe | ||
|
031a7bc4c5 | ||
|
d7486d0fd6 | ||
|
38931f0654 | ||
|
bb684ca4db | ||
|
25a76c343b | ||
|
817a49204d | ||
|
91b4db1982 | ||
|
8562f6c58c | ||
|
5abc309502 | ||
|
ecb5a88a2c | ||
|
782b749ea3 | ||
|
b834016dcb | ||
523945271e | |||
0af7ddd786 | |||
ba5add489d | |||
d5cb144799 | |||
4e92f6cdd3 | |||
aaa1c5cea4 | |||
4f302570a2 |
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
node_modules
|
||||||
|
doc
|
4
.env
@ -1,3 +1,7 @@
|
|||||||
PORT=3000
|
PORT=3000
|
||||||
IP=0.0.0.0 # Listening IPv4 or IPv6.
|
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).
|
ANNOUNCED_IP=185.8.154.190 # Announced IPv4 or IPv6 (useful when running mediasoup behind NAT with private IP).
|
||||||
|
RTC_MIN_PORT=2000
|
||||||
|
RTC_MAX_PORT=2020
|
||||||
|
SERVER_CERT="./server/ssl/cert.pem"
|
||||||
|
SERVER_KEY="./server/ssl/key.pem"
|
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/node_modules
|
/node_modules
|
||||||
|
/dist
|
||||||
|
26
Dockerfile
@ -1,11 +1,25 @@
|
|||||||
FROM ubuntu
|
FROM ubuntu:22.04
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y build-essential pip net-tools iputils-ping iproute2 curl
|
apt-get install -y build-essential pip net-tools iputils-ping iproute2 curl
|
||||||
|
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
|
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
|
||||||
RUN apt-get install -y nodejs
|
RUN apt-get install -y nodejs
|
||||||
RUN npm install -g watchify
|
|
||||||
|
|
||||||
EXPOSE 3000
|
COPY . /app/
|
||||||
EXPOSE 2000-2020
|
|
||||||
EXPOSE 10000-10100
|
RUN npm install
|
||||||
|
|
||||||
|
EXPOSE 3000/tcp
|
||||||
|
EXPOSE 2000-2200/udp
|
||||||
|
|
||||||
|
CMD node app.js
|
||||||
|
|
||||||
|
#docker build -t linx-video .
|
||||||
|
# docker run -it -d --restart always -p 3000:3000/tcp -p 2000-2200:2000-2200/udp linx-video
|
||||||
|
#Run under host network
|
||||||
|
# docker run -it -d --network host --restart always -p 3000:3000/tcp -p 2000-2200:2000-2200/udp linx-video
|
||||||
|
#https://docs.docker.com/config/containers/resource_constraints/
|
||||||
|
#docker run -it -d --network host --cpus="0.25" --memory="512m" --restart always -p 3000:3000/tcp -p 2000-2200:2000-2200/udp linx-video
|
18
README.md
@ -1,5 +1,11 @@
|
|||||||
# Video server
|
# Video server
|
||||||
|
|
||||||
|
### Generating certificates
|
||||||
|
|
||||||
|
##### To generate SSL certificates you must:
|
||||||
|
1. Go to `/server/ssl`
|
||||||
|
2. Execute `openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem`
|
||||||
|
|
||||||
|
|
||||||
### Development
|
### Development
|
||||||
|
|
||||||
@ -16,14 +22,20 @@
|
|||||||
2. Run the `npm start:prod` command to start the server in production mode.
|
2. Run the `npm start:prod` command to start the server in production mode.
|
||||||
(To connect to the terminal, use `pm2 log video-server`)
|
(To connect to the terminal, use `pm2 log video-server`)
|
||||||
|
|
||||||
---
|
|
||||||
|
### Web client
|
||||||
|
|
||||||
- The server will start by default on port 3000, and the ssl certificates will have to be configured
|
- The server will start by default on port 3000, and the ssl certificates will have to be configured
|
||||||
- The web client can be accessed using the /sfu path
|
- The web client can be accessed using the /sfu path
|
||||||
ex: http://localhost:3000/sfu/?assetId=1&&accountId=1&producer=true&assetName=Adi&assetType=linx
|
ex: https://HOST/sfu/?assetId=1&&accountId=1&producer=true&dest_asset_id=75&assetName=Adi
|
||||||
assetId = asset id of the unit on which you are doing the test
|
assetId = asset id of the unit on which you are doing the test
|
||||||
accountId = account id of the unit on which you are doing the test
|
accountId = account id of the unit on which you are doing the test
|
||||||
producer = it will always be true because you are the producer
|
producer = it will always be true because you are the producer
|
||||||
(it's possible to put false, but then you have to have another client with producer true)
|
(it's possible to put false, but then you have to have another client with producer true)
|
||||||
assetName = asset name of the unit on which you are doing the test
|
assetName = asset name of the unit on which you are doing the test
|
||||||
assetType = asset type of the unit on which you are doing the test
|
dest_asset_id= the addressee with whom the call is made
|
||||||
|
- To make a call using this client, you need a microphone and permission to use it
|
||||||
|
- For any changes related to the client, the command `npm run watch' will have to be used to generate the bundle.js used by the web client
|
||||||
|
|
||||||
|
### Demo project
|
||||||
|
The demo project used initially and then modified for our needs `https://github.com/jamalag/mediasoup2`
|
||||||
|
896
app.js
@ -1,299 +1,597 @@
|
|||||||
import 'dotenv/config'
|
require('dotenv').config();
|
||||||
|
|
||||||
/**
|
const express = require('express');
|
||||||
* integrating mediasoup server with a node.js application
|
const app = express();
|
||||||
*/
|
const Server = require('socket.io');
|
||||||
|
const path = require('node:path');
|
||||||
/* Please follow mediasoup installation requirements */
|
const fs = require('node:fs');
|
||||||
/* https://mediasoup.org/documentation/v3/mediasoup/installation/ */
|
let https;
|
||||||
import express from 'express'
|
try {
|
||||||
const app = express()
|
https = require('node:https');
|
||||||
|
} catch (err) {
|
||||||
import https from 'httpolyglot'
|
console.log('https support is disabled!');
|
||||||
import fs from 'fs'
|
}
|
||||||
import path from 'path'
|
const mediasoup = require('mediasoup');
|
||||||
const __dirname = path.resolve()
|
|
||||||
|
let worker;
|
||||||
import Server from 'socket.io'
|
/**
|
||||||
import mediasoup, { getSupportedRtpCapabilities } from 'mediasoup'
|
*
|
||||||
|
* videoCalls - Dictionary of Object(s)
|
||||||
let worker
|
* '<callId>': {
|
||||||
let router = {}
|
* router: Router,
|
||||||
let producerTransport
|
* initiatorAudioProducer: Producer,
|
||||||
let consumerTransport
|
* initiatorVideoProducer: Producer,
|
||||||
let producer
|
* receiverVideoProducer: Producer,
|
||||||
let consumer
|
* receiverAudioProducer: Producer,
|
||||||
|
* initiatorProducerTransport: Producer Transport,
|
||||||
app.get('/', (_req, res) => {
|
* receiverProducerTransport: Producer Transport,
|
||||||
res.send('Hello from mediasoup app!')
|
* initiatorConsumerVideo: Consumer,
|
||||||
})
|
* initiatorConsumerAudio: Consumer,
|
||||||
|
* initiatorConsumerTransport: Consumer Transport
|
||||||
app.use('/sfu', express.static(path.join(__dirname, 'public')))
|
* initiatorSocket
|
||||||
|
* receiverSocket
|
||||||
// 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')
|
let videoCalls = {};
|
||||||
}
|
let socketDetails = {};
|
||||||
|
|
||||||
const httpsServer = https.createServer(options, app)
|
app.get('/', (_req, res) => {
|
||||||
|
res.send('OK');
|
||||||
httpsServer.listen(process.env.PORT, () => {
|
});
|
||||||
console.log('Listening on port:', process.env.PORT)
|
|
||||||
})
|
app.use('/sfu', express.static(path.join(__dirname, 'public')));
|
||||||
|
|
||||||
const io = new Server(httpsServer)
|
// SSL cert for HTTPS access
|
||||||
|
const options = {
|
||||||
// socket.io namespace (could represent a room?)
|
key: fs.readFileSync(process.env.SERVER_KEY, 'utf-8'),
|
||||||
const peers = io.of('/mediasoup')
|
cert: fs.readFileSync(process.env.SERVER_CERT, 'utf-8'),
|
||||||
|
};
|
||||||
/**
|
|
||||||
* Worker
|
const httpsServer = https.createServer(options, app);
|
||||||
* |-> Router(s)
|
|
||||||
* |-> Producer Transport(s)
|
const io = new Server(httpsServer, {
|
||||||
* |-> Producer
|
allowEIO3: true,
|
||||||
* |-> Consumer Transport(s)
|
origins: ['*:*'],
|
||||||
* |-> Consumer
|
});
|
||||||
**/
|
|
||||||
|
httpsServer.listen(process.env.PORT, () => {
|
||||||
const createWorker = async () => {
|
console.log('Video server listening on port:', process.env.PORT);
|
||||||
worker = await mediasoup.createWorker({
|
});
|
||||||
rtcMinPort: 2000,
|
|
||||||
rtcMaxPort: 2020,
|
const peers = io.of('/');
|
||||||
})
|
|
||||||
console.log(`[createWorker] worker pid ${worker.pid}`)
|
const createWorker = async () => {
|
||||||
|
try {
|
||||||
worker.on('died', error => {
|
worker = await mediasoup.createWorker({
|
||||||
// This implies something serious happened, so kill the application
|
rtcMinPort: parseInt(process.env.RTC_MIN_PORT),
|
||||||
console.error('mediasoup worker has died', error)
|
rtcMaxPort: parseInt(process.env.RTC_MAX_PORT),
|
||||||
setTimeout(() => process.exit(1), 2000) // exit in 2 seconds
|
});
|
||||||
})
|
console.log(`[createWorker] worker pid ${worker.pid}`);
|
||||||
|
|
||||||
return worker
|
worker.on('died', (error) => {
|
||||||
}
|
// This implies something serious happened, so kill the application
|
||||||
|
console.error('mediasoup worker has died', error);
|
||||||
// We create a Worker as soon as our application starts
|
setTimeout(() => process.exit(1), 2000); // exit in 2 seconds
|
||||||
worker = createWorker()
|
});
|
||||||
|
return worker;
|
||||||
// This is an Array of RtpCapabilities
|
} catch (error) {
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpCodecCapability
|
console.error(`[createWorker] | ERROR | error: ${error.message}`);
|
||||||
// list of media codecs supported by mediasoup ...
|
}
|
||||||
// https://github.com/versatica/mediasoup/blob/v3/src/supportedRtpCapabilities.ts
|
};
|
||||||
const mediaCodecs = [
|
|
||||||
{
|
// We create a Worker as soon as our application starts
|
||||||
kind: 'audio',
|
worker = createWorker();
|
||||||
mimeType: 'audio/opus',
|
|
||||||
clockRate: 48000,
|
// This is an Array of RtpCapabilities
|
||||||
channels: 2,
|
// https://mediasoup.org/documentation/v3/mediasoup/rtp-parameters-and-capabilities/#RtpCodecCapability
|
||||||
},
|
// list of media codecs supported by mediasoup ...
|
||||||
{
|
// https://github.com/versatica/mediasoup/blob/v3/src/supportedRtpCapabilities.ts
|
||||||
kind: 'video',
|
const mediaCodecs = [
|
||||||
mimeType: 'video/VP8',
|
{
|
||||||
clockRate: 90000,
|
kind: 'audio',
|
||||||
parameters: {
|
mimeType: 'audio/opus',
|
||||||
'x-google-start-bitrate': 1000,
|
clockRate: 48000,
|
||||||
},
|
channels: 2,
|
||||||
},
|
},
|
||||||
]
|
{
|
||||||
|
kind: 'video',
|
||||||
peers.on('connection', async socket => {
|
mimeType: 'video/VP8',
|
||||||
console.log('[connection] socketId:', socket.id)
|
clockRate: 90000,
|
||||||
socket.emit('connection-success', {
|
parameters: {
|
||||||
socketId: socket.id,
|
'x-google-start-bitrate': 1000,
|
||||||
existsProducer: producer ? true : false,
|
},
|
||||||
})
|
channels: 2,
|
||||||
|
},
|
||||||
socket.on('disconnect', () => {
|
{
|
||||||
// do some cleanup
|
kind: 'video',
|
||||||
console.log('peer disconnected')
|
mimeType: 'video/VP9',
|
||||||
})
|
clockRate: 90000,
|
||||||
|
parameters: {
|
||||||
socket.on('createRoom', async ({ callId }, callback) => {
|
'profile-id': 2,
|
||||||
console.log('[createRoom] callId', callId);
|
'x-google-start-bitrate': 1000,
|
||||||
console.log('Router length:', Object.keys(router).length);
|
},
|
||||||
if (router[callId] === undefined) {
|
},
|
||||||
// worker.createRouter(options)
|
{
|
||||||
// options = { mediaCodecs, appData }
|
kind: 'video',
|
||||||
// mediaCodecs -> defined above
|
mimeType: 'video/h264',
|
||||||
// appData -> custom application data - we are not supplying any
|
clockRate: 90000,
|
||||||
// none of the two are required
|
parameters: {
|
||||||
router[callId] = await worker.createRouter({ mediaCodecs })
|
'packetization-mode': 1,
|
||||||
console.log(`[createRoom] Router ID: ${router[callId].id}`)
|
'profile-level-id': '4d0032',
|
||||||
}
|
'level-asymmetry-allowed': 1,
|
||||||
|
'x-google-start-bitrate': 1000,
|
||||||
getRtpCapabilities(callId, callback)
|
},
|
||||||
})
|
},
|
||||||
|
{
|
||||||
const getRtpCapabilities = (callId, callback) => {
|
kind: 'video',
|
||||||
const rtpCapabilities = router[callId].rtpCapabilities
|
mimeType: 'video/h264',
|
||||||
|
clockRate: 90000,
|
||||||
callback({ rtpCapabilities })
|
parameters: {
|
||||||
}
|
'packetization-mode': 1,
|
||||||
|
'profile-level-id': '42e01f',
|
||||||
// Client emits a request to create server side Transport
|
'level-asymmetry-allowed': 1,
|
||||||
// We need to differentiate between the producer and consumer transports
|
'x-google-start-bitrate': 1000,
|
||||||
socket.on('createWebRtcTransport', async ({ sender, callId }, callback) => {
|
},
|
||||||
console.log(`[createWebRtcTransport] Is this a sender request? ${sender} | callId ${callId}`)
|
},
|
||||||
// The client indicates if it is a producer or a consumer
|
];
|
||||||
// if sender is true, indicates a producer else a consumer
|
|
||||||
if (sender)
|
const closeCall = (callId) => {
|
||||||
producerTransport = await createWebRtcTransportLayer(callId, callback)
|
try {
|
||||||
else
|
if (callId && videoCalls[callId]) {
|
||||||
consumerTransport = await createWebRtcTransportLayer(callId, callback)
|
videoCalls[callId].receiverVideoProducer?.close();
|
||||||
})
|
videoCalls[callId].receiverAudioProducer?.close();
|
||||||
|
videoCalls[callId].initiatorConsumerVideo?.close();
|
||||||
// see client's socket.emit('transport-connect', ...)
|
videoCalls[callId].initiatorConsumerAudio?.close();
|
||||||
socket.on('transport-connect', async ({ dtlsParameters }) => {
|
|
||||||
console.log('[transport-connect] DTLS PARAMS... ', { dtlsParameters })
|
videoCalls[callId]?.initiatorConsumerTransport?.close();
|
||||||
await producerTransport.connect({ dtlsParameters })
|
videoCalls[callId]?.receiverProducerTransport?.close();
|
||||||
})
|
videoCalls[callId]?.router?.close();
|
||||||
|
delete videoCalls[callId];
|
||||||
// see client's socket.emit('transport-produce', ...)
|
console.log(`[closeCall] | callId: ${callId}`);
|
||||||
socket.on('transport-produce', async ({ kind, rtpParameters, appData }, callback) => {
|
}
|
||||||
// call produce based on the prameters from the client
|
} catch (error) {
|
||||||
producer = await producerTransport.produce({
|
console.error(`[closeCall] | ERROR | callId: ${callId} | error: ${error.message}`);
|
||||||
kind,
|
}
|
||||||
rtpParameters,
|
};
|
||||||
})
|
|
||||||
|
/*
|
||||||
console.log(`[transport-produce] Producer ID: ${producer.id} | kind: ${producer.kind}`)
|
- Handlers for WS events
|
||||||
|
- These are created only when we have a connection with a peer
|
||||||
producer.on('transportclose', () => {
|
*/
|
||||||
console.log('transport for this producer closed', callId)
|
peers.on('connection', async (socket) => {
|
||||||
|
console.log('[connection] socketId:', socket.id);
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup/api/#producer-close
|
|
||||||
producer.close()
|
// After making the connection successfully, we send the client a 'connection-success' event
|
||||||
|
socket.emit('connection-success', {
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-close
|
socketId: socket.id,
|
||||||
router[callId].close()
|
});
|
||||||
delete router[callId]
|
|
||||||
})
|
// It is triggered when the peer is disconnected
|
||||||
|
socket.on('disconnect', () => {
|
||||||
// Send back to the client the Producer's id
|
const callId = socketDetails[socket.id];
|
||||||
callback({
|
console.log(`disconnect | socket ${socket.id} | callId ${callId}`);
|
||||||
id: producer.id
|
delete socketDetails[socket.id];
|
||||||
})
|
closeCall(callId);
|
||||||
})
|
});
|
||||||
|
|
||||||
// see client's socket.emit('transport-recv-connect', ...)
|
/*
|
||||||
socket.on('transport-recv-connect', async ({ dtlsParameters }) => {
|
- This event creates a room with the roomId and the callId sent
|
||||||
console.log(`[transport-recv-connect] DTLS PARAMS: ${dtlsParameters}`)
|
- It will return the rtpCapabilities of that room
|
||||||
await consumerTransport.connect({ dtlsParameters })
|
- If the room already exists, it will not create it, but will only return rtpCapabilities
|
||||||
})
|
*/
|
||||||
|
socket.on('createRoom', async ({ callId }, callback) => {
|
||||||
socket.on('consume', async ({ rtpCapabilities, callId }, callback) => {
|
let callbackResponse = null;
|
||||||
try {
|
try {
|
||||||
console.log('consume', rtpCapabilities, callId);
|
// We can continue with the room creation process only if we have a callId
|
||||||
// check if the router can consume the specified producer
|
if (callId) {
|
||||||
if (router[callId].canConsume({
|
console.log(`[createRoom] socket.id ${socket.id} callId ${callId}`);
|
||||||
producerId: producer.id,
|
if (!videoCalls[callId]) {
|
||||||
rtpCapabilities
|
videoCalls[callId] = { router: await worker.createRouter({ mediaCodecs }) };
|
||||||
})) {
|
console.log(`[createRoom] Generate Router ID: ${videoCalls[callId].router.id}`);
|
||||||
// transport can now consume and return a consumer
|
videoCalls[callId].receiverSocket = socket;
|
||||||
consumer = await consumerTransport.consume({
|
} else {
|
||||||
producerId: producer.id,
|
videoCalls[callId].initiatorSocket = socket;
|
||||||
rtpCapabilities,
|
}
|
||||||
paused: true,
|
socketDetails[socket.id] = callId;
|
||||||
})
|
// rtpCapabilities is set for callback
|
||||||
|
callbackResponse = {
|
||||||
consumer.on('transportclose', () => {
|
rtpCapabilities: videoCalls[callId].router.rtpCapabilities,
|
||||||
console.log('transport close from consumer', callId)
|
};
|
||||||
// closeRoom(callId)
|
} else {
|
||||||
delete router[callId]
|
console.log(`[createRoom] missing callId: ${callId}`);
|
||||||
})
|
}
|
||||||
|
} catch (error) {
|
||||||
consumer.on('producerclose', () => {
|
console.error(`[createRoom] | ERROR | callId: ${callId} | error: ${error.message}`);
|
||||||
console.log('producer of consumer closed', callId)
|
} finally {
|
||||||
|
callback(callbackResponse);
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-close
|
}
|
||||||
router[callId].close()
|
});
|
||||||
delete router[callId]
|
|
||||||
})
|
/*
|
||||||
|
- Client emits a request to create server side Transport
|
||||||
// from the consumer extract the following params
|
- Depending on the sender, a producer or consumer is created is created on that router
|
||||||
// to send back to the Client
|
- It will return parameters, these are required for the client to create the RecvTransport
|
||||||
const params = {
|
from the client.
|
||||||
id: consumer.id,
|
- If the client is producer(sender: true) then it will use parameters for device.createSendTransport(params)
|
||||||
producerId: producer.id,
|
- If the client is a consumer(sender: false) then it will use parameters for device.createRecvTransport(params)
|
||||||
kind: consumer.kind,
|
*/
|
||||||
rtpParameters: consumer.rtpParameters,
|
socket.on('createWebRtcTransport', async ({ sender }, callback) => {
|
||||||
}
|
try {
|
||||||
|
const callId = socketDetails[socket.id];
|
||||||
// send the parameters to the client
|
console.log(`[createWebRtcTransport] socket ${socket.id} | sender ${sender} | callId ${callId}`);
|
||||||
callback({ params })
|
if (sender) {
|
||||||
}
|
if (!videoCalls[callId].receiverProducerTransport && !isInitiator(callId, socket.id)) {
|
||||||
} catch (error) {
|
videoCalls[callId].receiverProducerTransport = await createWebRtcTransportLayer(callId, callback);
|
||||||
console.log(error.message)
|
} else if (!videoCalls[callId].initiatorProducerTransport && isInitiator(callId, socket.id)) {
|
||||||
callback({
|
videoCalls[callId].initiatorProducerTransport = await createWebRtcTransportLayer(callId, callback);
|
||||||
params: {
|
} else {
|
||||||
error: error
|
console.log(`producerTransport has already been defined | callId ${callId}`);
|
||||||
}
|
callback(null);
|
||||||
})
|
}
|
||||||
}
|
} else if (!sender) {
|
||||||
})
|
if (!videoCalls[callId].receiverConsumerTransport && !isInitiator(callId, socket.id)) {
|
||||||
|
videoCalls[callId].receiverConsumerTransport = await createWebRtcTransportLayer(callId, callback);
|
||||||
socket.on('consumer-resume', async () => {
|
} else if (!videoCalls[callId].initiatorConsumerTransport && isInitiator(callId, socket.id)) {
|
||||||
console.log(`[consumer-resume]`)
|
videoCalls[callId].initiatorConsumerTransport = await createWebRtcTransportLayer(callId, callback);
|
||||||
await consumer.resume()
|
}
|
||||||
})
|
}
|
||||||
})
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
const createWebRtcTransportLayer = async (callId, callback) => {
|
`[createWebRtcTransport] | ERROR | callId: ${socketDetails[socket.id]} | sender: ${sender} | error: ${
|
||||||
try {
|
error.message
|
||||||
console.log('[createWebRtcTransportLayer] callId', callId);
|
}`
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions
|
);
|
||||||
const webRtcTransport_options = {
|
callback(error);
|
||||||
listenIps: [
|
}
|
||||||
{
|
});
|
||||||
ip: process.env.IP, // Listening IPv4 or IPv6.
|
|
||||||
announcedIp: process.env.ANNOUNCED_IP, // Announced IPv4 or IPv6 (useful when running mediasoup behind NAT with private IP).
|
/*
|
||||||
}
|
- The client sends this event after successfully creating a createSendTransport(AS PRODUCER)
|
||||||
],
|
- The connection is made to the created transport
|
||||||
enableUdp: true,
|
*/
|
||||||
enableTcp: true,
|
socket.on('transport-connect', async ({ dtlsParameters }) => {
|
||||||
preferUdp: true,
|
try {
|
||||||
}
|
const callId = socketDetails[socket.id];
|
||||||
|
if (typeof dtlsParameters === 'string') dtlsParameters = JSON.parse(dtlsParameters);
|
||||||
// console.log('webRtcTransport_options', webRtcTransport_options);
|
|
||||||
// console.log('router', router, '| router[callId]', router[callId]);
|
console.log(`[transport-connect] socket ${socket.id} | callId ${callId}`);
|
||||||
|
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-createWebRtcTransport
|
isInitiator(callId, socket.id)
|
||||||
let transport = await router[callId].createWebRtcTransport(webRtcTransport_options)
|
? await videoCalls[callId].initiatorProducerTransport.connect({ dtlsParameters })
|
||||||
console.log(`callId: ${callId} | transport id: ${transport.id}`)
|
: await videoCalls[callId].receiverProducerTransport.connect({ dtlsParameters });
|
||||||
|
} catch (error) {
|
||||||
transport.on('dtlsstatechange', dtlsState => {
|
console.error(`[transport-connect] | ERROR | callId: ${socketDetails[socket.id]} | error: ${error.message}`);
|
||||||
if (dtlsState === 'closed') {
|
}
|
||||||
transport.close()
|
});
|
||||||
}
|
|
||||||
})
|
/*
|
||||||
|
- The event sent by the client (PRODUCER) after successfully connecting to receiverProducerTransport/initiatorProducerTransport
|
||||||
transport.on('close', () => {
|
- For the router with the id callId, we make produce on receiverProducerTransport/initiatorProducerTransport
|
||||||
console.log('transport closed')
|
- Create the handler on producer at the 'transportclose' event
|
||||||
})
|
*/
|
||||||
|
socket.on('transport-produce', async ({ kind, rtpParameters, appData }, callback) => {
|
||||||
const params = {
|
try {
|
||||||
id: transport.id,
|
const callId = socketDetails[socket.id];
|
||||||
iceParameters: transport.iceParameters,
|
if (typeof rtpParameters === 'string') rtpParameters = JSON.parse(rtpParameters);
|
||||||
iceCandidates: transport.iceCandidates,
|
|
||||||
dtlsParameters: transport.dtlsParameters,
|
console.log(`[transport-produce] callId: ${callId} | kind: ${kind} | socket: ${socket.id}`);
|
||||||
}
|
|
||||||
|
if (kind === 'video') {
|
||||||
console.log('params', params);
|
if (!isInitiator(callId, socket.id)) {
|
||||||
|
videoCalls[callId].receiverVideoProducer = await videoCalls[callId].receiverProducerTransport.produce({
|
||||||
// send back to the client the following prameters
|
kind,
|
||||||
callback({
|
rtpParameters,
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
|
});
|
||||||
params
|
|
||||||
})
|
videoCalls[callId].receiverVideoProducer.on('transportclose', () => {
|
||||||
|
console.log('transport for this producer closed', callId);
|
||||||
return transport
|
closeCall(callId);
|
||||||
|
});
|
||||||
} catch (error) {
|
|
||||||
console.log('[createWebRtcTransportLayer] ERROR', JSON.stringify(error));
|
// Send back to the client the Producer's id
|
||||||
callback({
|
callback &&
|
||||||
params: {
|
callback({
|
||||||
error: error
|
id: videoCalls[callId].receiverVideoProducer.id,
|
||||||
}
|
});
|
||||||
})
|
} else {
|
||||||
}
|
videoCalls[callId].initiatorVideoProducer = await videoCalls[callId].initiatorProducerTransport.produce({
|
||||||
}
|
kind,
|
||||||
|
rtpParameters,
|
||||||
|
});
|
||||||
|
|
||||||
|
videoCalls[callId].initiatorVideoProducer.on('transportclose', () => {
|
||||||
|
console.log('transport for this producer closed', callId);
|
||||||
|
closeCall(callId);
|
||||||
|
});
|
||||||
|
|
||||||
|
callback &&
|
||||||
|
callback({
|
||||||
|
id: videoCalls[callId].initiatorVideoProducer.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (kind === 'audio') {
|
||||||
|
if (!isInitiator(callId, socket.id)) {
|
||||||
|
videoCalls[callId].receiverAudioProducer = await videoCalls[callId].receiverProducerTransport.produce({
|
||||||
|
kind,
|
||||||
|
rtpParameters,
|
||||||
|
});
|
||||||
|
|
||||||
|
videoCalls[callId].receiverAudioProducer.on('transportclose', () => {
|
||||||
|
console.log('transport for this producer closed', callId);
|
||||||
|
closeCall(callId);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Send back to the client the Producer's id
|
||||||
|
callback &&
|
||||||
|
callback({
|
||||||
|
id: videoCalls[callId].receiverAudioProducer.id,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
videoCalls[callId].initiatorAudioProducer = await videoCalls[callId].initiatorProducerTransport.produce({
|
||||||
|
kind,
|
||||||
|
rtpParameters,
|
||||||
|
});
|
||||||
|
|
||||||
|
videoCalls[callId].initiatorAudioProducer.on('transportclose', () => {
|
||||||
|
console.log('transport for this producer closed', callId);
|
||||||
|
closeCall(callId);
|
||||||
|
});
|
||||||
|
|
||||||
|
// Send back to the client the Producer's id
|
||||||
|
callback &&
|
||||||
|
callback({
|
||||||
|
id: videoCalls[callId].initiatorAudioProducer.id,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const socketToEmit = isInitiator(callId, socket.id)
|
||||||
|
? videoCalls[callId].receiverSocket
|
||||||
|
: videoCalls[callId].initiatorSocket;
|
||||||
|
|
||||||
|
// callId - Id of the call
|
||||||
|
// kind - producer type: audio/video
|
||||||
|
socketToEmit?.emit('new-producer', { callId, kind });
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`[transport-produce] | ERROR | callId: ${socketDetails[socket.id]} | error: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
- The client sends this event after successfully creating a createRecvTransport(AS CONSUMER)
|
||||||
|
- The connection is made to the created consumerTransport
|
||||||
|
*/
|
||||||
|
socket.on('transport-recv-connect', async ({ dtlsParameters }) => {
|
||||||
|
try {
|
||||||
|
const callId = socketDetails[socket.id];
|
||||||
|
console.log(`[transport-recv-connect] socket ${socket.id} | callId ${callId}`);
|
||||||
|
if (typeof dtlsParameters === 'string') dtlsParameters = JSON.parse(dtlsParameters);
|
||||||
|
// await videoCalls[callId].consumerTransport.connect({ dtlsParameters });
|
||||||
|
if (!isInitiator(callId, socket.id)) {
|
||||||
|
await videoCalls[callId].receiverConsumerTransport.connect({ dtlsParameters });
|
||||||
|
} else if (isInitiator(callId, socket.id)) {
|
||||||
|
await videoCalls[callId].initiatorConsumerTransport.connect({ dtlsParameters });
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`[transport-recv-connect] | ERROR | callId: ${socketDetails[socket.id]} | error: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
- The customer consumes after successfully connecting to consumerTransport
|
||||||
|
- The previous step was 'transport-recv-connect', and before that 'createWebRtcTransport'
|
||||||
|
- This event is only sent by the consumer
|
||||||
|
- The parameters that the consumer consumes are returned
|
||||||
|
- The consumer does consumerTransport.consume(params)
|
||||||
|
*/
|
||||||
|
socket.on('consume', async ({ rtpCapabilities }, callback) => {
|
||||||
|
const callId = socketDetails[socket.id];
|
||||||
|
const socketId = socket.id;
|
||||||
|
|
||||||
|
console.log(`[consume] socket ${socketId} | callId: ${callId}`);
|
||||||
|
|
||||||
|
if (typeof rtpCapabilities === 'string') rtpCapabilities = JSON.parse(rtpCapabilities);
|
||||||
|
|
||||||
|
callback({
|
||||||
|
videoParams: await consumeVideo({ callId, socketId, rtpCapabilities }),
|
||||||
|
audioParams: await consumeAudio({ callId, socketId, rtpCapabilities }),
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
- Event sent by the consumer after consuming to resume the pause
|
||||||
|
- When consuming on consumerTransport, it is initially done with paused: true, here we will resume
|
||||||
|
- For the initiator we resume the initiatorConsumerAUDIO/VIDEO and for receiver the receiverConsumerAUDIO/VIDEO
|
||||||
|
*/
|
||||||
|
socket.on('consumer-resume', () => {
|
||||||
|
try {
|
||||||
|
const callId = socketDetails[socket.id];
|
||||||
|
const isInitiatorValue = isInitiator(callId, socket.id);
|
||||||
|
console.log(`[consumer-resume] callId: ${callId} | isInitiator: ${isInitiatorValue}`);
|
||||||
|
|
||||||
|
const consumerVideo = isInitiatorValue
|
||||||
|
? videoCalls[callId].initiatorConsumerVideo
|
||||||
|
: videoCalls[callId].receiverConsumerVideo;
|
||||||
|
|
||||||
|
const consumerAudio = isInitiatorValue
|
||||||
|
? videoCalls[callId].initiatorConsumerAudio
|
||||||
|
: videoCalls[callId].receiverConsumerAudio;
|
||||||
|
|
||||||
|
consumerVideo?.resume();
|
||||||
|
consumerAudio?.resume();
|
||||||
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
`[consumer-resume] | ERROR | callId: ${socketDetails[socket.id]} | isInitiator: ${isInitiator} | error: ${
|
||||||
|
error.message
|
||||||
|
}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
socket.on('close-producer', ({ callId, kind }) => {
|
||||||
|
try {
|
||||||
|
if (isInitiator(callId, socket.id)) {
|
||||||
|
console.log(`[close-producer] initiator --EMIT--> receiver | callId: ${callId} | kind: ${kind}`);
|
||||||
|
videoCalls[callId].receiverSocket.emit('close-producer', { callId, kind });
|
||||||
|
} else {
|
||||||
|
console.log(`[close-producer] receiver --EMIT--> initiator | callId: ${callId} | kind: ${kind}`);
|
||||||
|
videoCalls[callId].initiatorSocket.emit('close-producer', { callId, kind });
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`[close-producer] | ERROR | callId: ${socketDetails[socket.id]} | error: ${error.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
const canConsume = ({ callId, producerId, rtpCapabilities }) => {
|
||||||
|
return !!videoCalls[callId].router.canConsume({
|
||||||
|
producerId,
|
||||||
|
rtpCapabilities,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const consumeVideo = async ({ callId, socketId, rtpCapabilities }) => {
|
||||||
|
// Handlers for consumer transport https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-on-transportclose
|
||||||
|
if (isInitiator(callId, socketId) && videoCalls[callId].receiverVideoProducer) {
|
||||||
|
const producerId = videoCalls[callId].receiverVideoProducer.id;
|
||||||
|
if (!canConsume({ callId, producerId, rtpCapabilities })) return null;
|
||||||
|
|
||||||
|
videoCalls[callId].initiatorConsumerVideo = await videoCalls[callId].initiatorConsumerTransport.consume({
|
||||||
|
producerId,
|
||||||
|
rtpCapabilities,
|
||||||
|
paused: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: videoCalls[callId].initiatorConsumerVideo.id,
|
||||||
|
producerId,
|
||||||
|
kind: 'video',
|
||||||
|
rtpParameters: videoCalls[callId].initiatorConsumerVideo.rtpParameters,
|
||||||
|
};
|
||||||
|
} else if (videoCalls[callId].initiatorVideoProducer) {
|
||||||
|
const producerId = videoCalls[callId].initiatorVideoProducer.id;
|
||||||
|
if (!canConsume({ callId, producerId, rtpCapabilities })) return null;
|
||||||
|
|
||||||
|
videoCalls[callId].receiverConsumerVideo = await videoCalls[callId].receiverConsumerTransport.consume({
|
||||||
|
producerId,
|
||||||
|
rtpCapabilities,
|
||||||
|
paused: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: videoCalls[callId].receiverConsumerVideo.id,
|
||||||
|
producerId,
|
||||||
|
kind: 'video',
|
||||||
|
rtpParameters: videoCalls[callId].receiverConsumerVideo.rtpParameters,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const consumeAudio = async ({ callId, socketId, rtpCapabilities }) => {
|
||||||
|
try {
|
||||||
|
// Handlers for consumer transport https://mediasoup.org/documentation/v3/mediasoup/api/#consumer-on-transportclose
|
||||||
|
if (isInitiator(callId, socketId) && videoCalls[callId].receiverAudioProducer) {
|
||||||
|
const producerId = videoCalls[callId].receiverAudioProducer.id;
|
||||||
|
if (!canConsume({ callId, producerId, rtpCapabilities })) return null;
|
||||||
|
|
||||||
|
videoCalls[callId].initiatorConsumerAudio = await videoCalls[callId].initiatorConsumerTransport.consume({
|
||||||
|
producerId,
|
||||||
|
rtpCapabilities,
|
||||||
|
paused: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: videoCalls[callId].initiatorConsumerAudio.id,
|
||||||
|
producerId,
|
||||||
|
kind: 'audio',
|
||||||
|
rtpParameters: videoCalls[callId].initiatorConsumerAudio.rtpParameters,
|
||||||
|
};
|
||||||
|
} else if (videoCalls[callId].initiatorAudioProducer) {
|
||||||
|
const producerId = videoCalls[callId].initiatorAudioProducer.id;
|
||||||
|
if (!canConsume({ callId, producerId, rtpCapabilities })) return null;
|
||||||
|
|
||||||
|
videoCalls[callId].receiverConsumerAudio = await videoCalls[callId].receiverConsumerTransport.consume({
|
||||||
|
producerId,
|
||||||
|
rtpCapabilities,
|
||||||
|
paused: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
id: videoCalls[callId].receiverConsumerAudio.id,
|
||||||
|
producerId,
|
||||||
|
kind: 'audio',
|
||||||
|
rtpParameters: videoCalls[callId].receiverConsumerAudio.rtpParameters,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`[consumeAudio] | ERROR | error: ${error}`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const isInitiator = (callId, socketId) => {
|
||||||
|
return videoCalls[callId]?.initiatorSocket?.id === socketId;
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
- Called from at event 'createWebRtcTransport' and assigned to the consumer or producer transport
|
||||||
|
- It will return parameters, these are required for the client to create the RecvTransport
|
||||||
|
from the client.
|
||||||
|
- If the client is producer(sender: true) then it will use parameters for device.createSendTransport(params)
|
||||||
|
- If the client is a consumer(sender: false) then it will use parameters for device.createRecvTransport(params)
|
||||||
|
*/
|
||||||
|
const createWebRtcTransportLayer = async (callId, callback) => {
|
||||||
|
try {
|
||||||
|
console.log(`[createWebRtcTransportLayer] callId: ${callId}`);
|
||||||
|
// https://mediasoup.org/documentation/v3/mediasoup/api/#WebRtcTransportOptions
|
||||||
|
const webRtcTransport_options = {
|
||||||
|
listenIps: [
|
||||||
|
{
|
||||||
|
ip: process.env.IP, // Listening IPv4 or IPv6.
|
||||||
|
announcedIp: process.env.ANNOUNCED_IP, // Announced IPv4 or IPv6 (useful when running mediasoup behind NAT with private IP).
|
||||||
|
},
|
||||||
|
],
|
||||||
|
enableUdp: true,
|
||||||
|
enableTcp: true,
|
||||||
|
preferUdp: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
// https://mediasoup.org/documentation/v3/mediasoup/api/#router-createWebRtcTransport
|
||||||
|
let transport = await videoCalls[callId].router.createWebRtcTransport(webRtcTransport_options);
|
||||||
|
|
||||||
|
// Handler for when DTLS(Datagram Transport Layer Security) changes
|
||||||
|
transport.on('dtlsstatechange', (dtlsState) => {
|
||||||
|
console.log(`transport | dtlsstatechange | calldId ${callId} | dtlsState ${dtlsState}`);
|
||||||
|
if (dtlsState === 'closed') {
|
||||||
|
transport.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Handler if the transport layer has closed (for various reasons)
|
||||||
|
transport.on('close', () => {
|
||||||
|
console.log(`transport | closed | calldId ${callId}`);
|
||||||
|
});
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
id: transport.id,
|
||||||
|
iceParameters: transport.iceParameters,
|
||||||
|
iceCandidates: transport.iceCandidates,
|
||||||
|
dtlsParameters: transport.dtlsParameters,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Send back to the client the params
|
||||||
|
callback({ params });
|
||||||
|
|
||||||
|
// Set transport to producerTransport or consumerTransport
|
||||||
|
return transport;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(
|
||||||
|
`[createWebRtcTransportLayer] | ERROR | callId: ${socketDetails[socket.id]} | error: ${error.message}`
|
||||||
|
);
|
||||||
|
callback({ params: { error } });
|
||||||
|
}
|
||||||
|
};
|
||||||
|
75
build.sh
Executable file
@ -0,0 +1,75 @@
|
|||||||
|
#/!bin/bash
|
||||||
|
## FUNCTIONS
|
||||||
|
function getGitVersion(){
|
||||||
|
version=$(git describe)
|
||||||
|
count=$(echo ${version%%-*} | grep -o "\." | wc -l)
|
||||||
|
if (( $count > 1 )); then
|
||||||
|
version=${version%%-*}
|
||||||
|
elif (( $count == 0 ));then
|
||||||
|
echo -e "Error: Git version \"${version%%-*}\" not respecting Safemobile standard.\n Must be like 4.xx or 4.xx.xx"
|
||||||
|
version="0.0.0"
|
||||||
|
else
|
||||||
|
if [[ "$1" == "dev" ]];then
|
||||||
|
cleanprefix=${version#*-} # remove everything before `-` including `-`
|
||||||
|
cleansuffix=${cleanprefix%-*} # remove everything after `-` including `-`
|
||||||
|
version="${version%%-*}.${cleansuffix}"
|
||||||
|
else
|
||||||
|
version="${version%%-*}.0" # one `%` remove everything after last `-`, two `%%` remove everything after all `-`
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
function addVersionPm2(){
|
||||||
|
file_pkg="package.json"
|
||||||
|
key=" \"version\": \""
|
||||||
|
|
||||||
|
if [ -f "$file_pkg" ] && [ ! -z "$version" ]; then
|
||||||
|
versionApp=" \"version\": \"$version\","
|
||||||
|
sed -i "s|^.*$key.*|${versionApp//\//\\/}|g" $file_pkg
|
||||||
|
text=$(cat $file_pkg | grep -c "$version")
|
||||||
|
if [ $text -eq 0 ]; then
|
||||||
|
echo "Version couldn't be set"
|
||||||
|
else
|
||||||
|
echo "Version $version successfully applied to App"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
## PREBUILD PROCESS
|
||||||
|
# check dist dir to be present and empty
|
||||||
|
if [ ! -d "dist" ]; then
|
||||||
|
## MAKE DIR
|
||||||
|
mkdir "dist"
|
||||||
|
echo "Directory dist created."
|
||||||
|
else
|
||||||
|
## CLEANUP
|
||||||
|
rm -fr dist/*
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d "node_modules" ]; then
|
||||||
|
rm -fr node_modules
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
#npm install
|
||||||
|
|
||||||
|
## PROJECT NEEDS
|
||||||
|
echo "Building app... from $(git rev-parse --abbrev-ref HEAD)"
|
||||||
|
#npm run-script build
|
||||||
|
cp -r {.env,app.js,package.json,server,public,doc,Dockerfile} dist/
|
||||||
|
#cp -r ./* dist/
|
||||||
|
|
||||||
|
# Generate Git log
|
||||||
|
dateString=$(date +"%Y%m%d-%H%M%S")
|
||||||
|
git log --pretty=format:"%ad%x09%an%x09%s" --no-merges -20 > "dist/git-$dateString.log"
|
||||||
|
|
||||||
|
# Get Git version control
|
||||||
|
getGitVersion $1
|
||||||
|
|
||||||
|
# Add version control for pm2
|
||||||
|
cd dist
|
||||||
|
addVersionPm2
|
||||||
|
|
||||||
|
## POST BUILD
|
||||||
|
|
||||||
|
cd -
|
BIN
doc/[video] Client - Mediasoup connect & produce@1.25x.png
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
doc/[video] Client Android-iOS close Video call@1.25x.png
Normal file
After Width: | Height: | Size: 419 KiB |
BIN
doc/[video] Client-Client Workflow@1.25x.png
Normal file
After Width: | Height: | Size: 1.0 MiB |
BIN
doc/[video] Dispatcher closed@1.25x.png
Normal file
After Width: | Height: | Size: 606 KiB |
After Width: | Height: | Size: 349 KiB |
BIN
doc/[video] HUB - Dispatcher close call@1.25x.png
Normal file
After Width: | Height: | Size: 412 KiB |
BIN
doc/[video] HUB - Dispatcher dieconnect@1.25x.png
Normal file
After Width: | Height: | Size: 421 KiB |
BIN
doc/[video] Video Window closed@1.25x.png
Normal file
After Width: | Height: | Size: 567 KiB |
BIN
doc/[video] Waiting Call@1.25x.png
Normal file
After Width: | Height: | Size: 660 KiB |
595
package-lock.json
generated
@ -12,7 +12,6 @@
|
|||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"httpolyglot": "^0.1.2",
|
|
||||||
"mediasoup": "^3.10.4",
|
"mediasoup": "^3.10.4",
|
||||||
"mediasoup-client": "^3.6.54",
|
"mediasoup-client": "^3.6.54",
|
||||||
"parcel": "^2.7.0",
|
"parcel": "^2.7.0",
|
||||||
@ -1792,27 +1791,6 @@
|
|||||||
"node": ">=10"
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@pm2/agent/node_modules/ws": {
|
|
||||||
"version": "7.4.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
|
|
||||||
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8.3.0"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"bufferutil": "^4.0.1",
|
|
||||||
"utf-8-validate": "^5.0.2"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"bufferutil": {
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"utf-8-validate": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@pm2/io": {
|
"node_modules/@pm2/io": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@pm2/io/-/io-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@pm2/io/-/io-5.0.0.tgz",
|
||||||
@ -2388,11 +2366,6 @@
|
|||||||
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
|
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/async-limiter": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
|
|
||||||
},
|
|
||||||
"node_modules/async-listener": {
|
"node_modules/async-listener": {
|
||||||
"version": "0.6.10",
|
"version": "0.6.10",
|
||||||
"resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz",
|
"resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz",
|
||||||
@ -2455,9 +2428,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/base64-arraybuffer": {
|
"node_modules/base64-arraybuffer": {
|
||||||
"version": "0.1.5",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz",
|
||||||
"integrity": "sha512-437oANT9tP582zZMwSvZGy2nmSeAb8DW2me3y+Uv1Wp2Rulr8Mqlyrv3E7MLxmsiaPSMMDmiDVzgE+e8zlMx9g==",
|
"integrity": "sha512-a1eIFi4R9ySrbiMuyTGx5e92uRH5tQY6kArNcFaKBUleIoLjdjBg7Zxm3Mqm3Kmkf27HLR/1fnxX9q8GQ7Iavg==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6.0"
|
"node": ">= 0.6.0"
|
||||||
}
|
}
|
||||||
@ -2483,22 +2456,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/base64id": {
|
"node_modules/base64id": {
|
||||||
"version": "1.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
|
||||||
"integrity": "sha512-rz8L+d/xByiB/vLVftPkyY215fqNrmasrcJsYkVcm4TgJNz+YXKrFaFAWibSaHkiKoSgMDCb+lipOIRQNGYesw==",
|
"integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.4.0"
|
"node": "^4.5.0 || >= 5.9"
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/better-assert": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-bYeph2DFlpK1XmGs6fvlLRUN29QISM3GBuUwSFsMY2XRx4AvC0WNCS57j4c/xGrK2RS24C1w3YoBOsw9fT46tQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"callsite": "1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": "*"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/binary-extensions": {
|
"node_modules/binary-extensions": {
|
||||||
@ -2875,14 +2837,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/callsite": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": "*"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/callsites": {
|
"node_modules/callsites": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||||
@ -3051,9 +3005,9 @@
|
|||||||
"integrity": "sha512-WZveuKPeKAG9qY+FkYDeADzdHyTYdIboXS59ixDeRJL5ZhxpqUnxSOwop4FQjMsiYm3/Or8cegVbpAHNA7pHxw=="
|
"integrity": "sha512-WZveuKPeKAG9qY+FkYDeADzdHyTYdIboXS59ixDeRJL5ZhxpqUnxSOwop4FQjMsiYm3/Or8cegVbpAHNA7pHxw=="
|
||||||
},
|
},
|
||||||
"node_modules/component-emitter": {
|
"node_modules/component-emitter": {
|
||||||
"version": "1.2.1",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
|
||||||
"integrity": "sha512-jPatnhd33viNplKjqXKRkGU345p263OIWzDL2wH3LGIGp5Kojo+uXizHmOADRvhGFFTnJqX3jBAKP6vvmSDKcA=="
|
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
|
||||||
},
|
},
|
||||||
"node_modules/component-inherit": {
|
"node_modules/component-inherit": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
@ -3629,36 +3583,36 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/engine.io": {
|
"node_modules/engine.io": {
|
||||||
"version": "3.1.5",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.6.0.tgz",
|
||||||
"integrity": "sha512-D06ivJkYxyRrcEe0bTpNnBQNgP9d3xog+qZlLbui8EsMr/DouQpf5o9FzJnWYHEYE0YsFHllUv2R1dkgYZXHcA==",
|
"integrity": "sha512-Kc8fo5bbg8F4a2f3HPHTEpGyq/IRIQpyeHu3H1ThR14XDD7VrLcsGBo16HUpahgp8YkHJDaU5gNxJZbuGcuueg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"accepts": "~1.3.4",
|
"accepts": "~1.3.4",
|
||||||
"base64id": "1.0.0",
|
"base64id": "2.0.0",
|
||||||
"cookie": "0.3.1",
|
"cookie": "~0.4.1",
|
||||||
"debug": "~3.1.0",
|
"debug": "~4.1.0",
|
||||||
"engine.io-parser": "~2.1.0",
|
"engine.io-parser": "~2.2.0",
|
||||||
"ws": "~3.3.1"
|
"ws": "~7.4.2"
|
||||||
},
|
},
|
||||||
"optionalDependencies": {
|
"engines": {
|
||||||
"uws": "~9.14.0"
|
"node": ">=8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/engine.io-client": {
|
"node_modules/engine.io-client": {
|
||||||
"version": "3.1.6",
|
"version": "3.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.3.tgz",
|
||||||
"integrity": "sha512-hnuHsFluXnsKOndS4Hv6SvUrgdYx1pk2NqfaDMW+GWdgfU3+/V25Cj7I8a0x92idSpa5PIhJRKxPvp9mnoLsfg==",
|
"integrity": "sha512-qsgyc/CEhJ6cgMUwxRRtOndGVhIu5hpL5tR4umSpmX/MvkFoIxUTM7oFMDQumHNzlNLwSVy6qhstFPoWTf7dOw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"component-emitter": "1.2.1",
|
"component-emitter": "~1.3.0",
|
||||||
"component-inherit": "0.0.3",
|
"component-inherit": "0.0.3",
|
||||||
"debug": "~3.1.0",
|
"debug": "~3.1.0",
|
||||||
"engine.io-parser": "~2.1.1",
|
"engine.io-parser": "~2.2.0",
|
||||||
"has-cors": "1.1.0",
|
"has-cors": "1.1.0",
|
||||||
"indexof": "0.0.1",
|
"indexof": "0.0.1",
|
||||||
"parseqs": "0.0.5",
|
"parseqs": "0.0.6",
|
||||||
"parseuri": "0.0.5",
|
"parseuri": "0.0.6",
|
||||||
"ws": "~3.3.1",
|
"ws": "~7.4.2",
|
||||||
"xmlhttprequest-ssl": "~1.5.4",
|
"xmlhttprequest-ssl": "~1.6.2",
|
||||||
"yeast": "0.1.2"
|
"yeast": "0.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -3671,33 +3625,39 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/engine.io-parser": {
|
"node_modules/engine.io-parser": {
|
||||||
"version": "2.1.3",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz",
|
||||||
"integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==",
|
"integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"after": "0.8.2",
|
"after": "0.8.2",
|
||||||
"arraybuffer.slice": "~0.0.7",
|
"arraybuffer.slice": "~0.0.7",
|
||||||
"base64-arraybuffer": "0.1.5",
|
"base64-arraybuffer": "0.1.4",
|
||||||
"blob": "0.0.5",
|
"blob": "0.0.5",
|
||||||
"has-binary2": "~1.0.2"
|
"has-binary2": "~1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/engine.io/node_modules/cookie": {
|
"node_modules/engine.io/node_modules/cookie": {
|
||||||
"version": "0.3.1",
|
"version": "0.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz",
|
||||||
"integrity": "sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw==",
|
"integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/engine.io/node_modules/debug": {
|
"node_modules/engine.io/node_modules/debug": {
|
||||||
"version": "3.1.0",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ms": "2.0.0"
|
"ms": "^2.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/engine.io/node_modules/ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
|
},
|
||||||
"node_modules/enquirer": {
|
"node_modules/enquirer": {
|
||||||
"version": "2.3.6",
|
"version": "2.3.6",
|
||||||
"resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
|
"resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz",
|
||||||
@ -4603,14 +4563,6 @@
|
|||||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/httpolyglot": {
|
|
||||||
"version": "0.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/httpolyglot/-/httpolyglot-0.1.2.tgz",
|
|
||||||
"integrity": "sha512-ouHI1AaQMLgn4L224527S5+vq6hgvqPteurVfbm7ChViM3He2Wa8KP1Ny7pTYd7QKnDSPKcN8JYfC8r/lmsE3A==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/https-browserify": {
|
"node_modules/https-browserify": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
|
||||||
@ -5758,15 +5710,11 @@
|
|||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||||
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/object-component": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz",
|
|
||||||
"integrity": "sha512-S0sN3agnVh2SZNEIGc0N1X4Z5K0JeFbGBrnuZpsxuUh5XLF0BnvWkMjRXo/zGKLd/eghvNIKcx1pQkmUjXIyrA=="
|
|
||||||
},
|
|
||||||
"node_modules/object-inspect": {
|
"node_modules/object-inspect": {
|
||||||
"version": "1.12.2",
|
"version": "1.12.2",
|
||||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
|
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
|
||||||
@ -6046,20 +5994,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/parseqs": {
|
"node_modules/parseqs": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz",
|
||||||
"integrity": "sha512-B3Nrjw2aL7aI4TDujOzfA4NsEc4u1lVcIRE0xesutH8kjeWF70uk+W5cBlIQx04zUH9NTBvuN36Y9xLRPK6Jjw==",
|
"integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w=="
|
||||||
"dependencies": {
|
|
||||||
"better-assert": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"node_modules/parseuri": {
|
"node_modules/parseuri": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz",
|
||||||
"integrity": "sha512-ijhdxJu6l5Ru12jF0JvzXVPvsC+VibqeaExlNoMhWN6VQ79PGjkmc7oA4W1lp00sFkNyj0fx6ivPLdV51/UMog==",
|
"integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow=="
|
||||||
"dependencies": {
|
|
||||||
"better-assert": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"node_modules/parseurl": {
|
"node_modules/parseurl": {
|
||||||
"version": "1.3.3",
|
"version": "1.3.3",
|
||||||
@ -7061,16 +7003,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/socket.io": {
|
"node_modules/socket.io": {
|
||||||
"version": "2.0.3",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.5.0.tgz",
|
||||||
"integrity": "sha512-qya7+ILKQ9vbXwJ/bUkT5Oe4RCD8c7Z9bZSg3jDDnuNxl+thkzgYz4BB+Oe8hxh1pF2xRbZUnIbrFw7+lpp94w==",
|
"integrity": "sha512-gGunfS0od3VpwDBpGwVkzSZx6Aqo9uOcf1afJj2cKnKFAoyl16fvhpsUhmUFd4Ldbvl5JvRQed6eQw6oQp6n8w==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": "~2.6.6",
|
"debug": "~4.1.0",
|
||||||
"engine.io": "~3.1.0",
|
"engine.io": "~3.6.0",
|
||||||
"object-assign": "~4.1.1",
|
"has-binary2": "~1.0.2",
|
||||||
"socket.io-adapter": "~1.1.0",
|
"socket.io-adapter": "~1.1.0",
|
||||||
"socket.io-client": "~2.0.2",
|
"socket.io-client": "2.5.0",
|
||||||
"socket.io-parser": "~3.1.1"
|
"socket.io-parser": "~3.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/socket.io-adapter": {
|
"node_modules/socket.io-adapter": {
|
||||||
@ -7079,37 +7021,24 @@
|
|||||||
"integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g=="
|
"integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g=="
|
||||||
},
|
},
|
||||||
"node_modules/socket.io-client": {
|
"node_modules/socket.io-client": {
|
||||||
"version": "2.0.3",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.5.0.tgz",
|
||||||
"integrity": "sha512-Lx7dCP7xCLKNXB5IB5AH37YoIjxAHLxQxXPFx0uTj9juQAayWUIwS6VS9Qn3I3eESIoQzjvsatAW1w4qb3ek9A==",
|
"integrity": "sha512-lOO9clmdgssDykiOmVQQitwBAF3I6mYcQAo7hQ7AM6Ny5X7fp8hIJ3HcQs3Rjz4SoggoxA1OgrQyY8EgTbcPYw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"backo2": "1.0.2",
|
"backo2": "1.0.2",
|
||||||
"base64-arraybuffer": "0.1.5",
|
|
||||||
"component-bind": "1.0.0",
|
"component-bind": "1.0.0",
|
||||||
"component-emitter": "1.2.1",
|
"component-emitter": "~1.3.0",
|
||||||
"debug": "~2.6.4",
|
"debug": "~3.1.0",
|
||||||
"engine.io-client": "~3.1.0",
|
"engine.io-client": "~3.5.0",
|
||||||
"has-cors": "1.1.0",
|
"has-binary2": "~1.0.2",
|
||||||
"indexof": "0.0.1",
|
"indexof": "0.0.1",
|
||||||
"object-component": "0.0.3",
|
"parseqs": "0.0.6",
|
||||||
"parseqs": "0.0.5",
|
"parseuri": "0.0.6",
|
||||||
"parseuri": "0.0.5",
|
"socket.io-parser": "~3.3.0",
|
||||||
"socket.io-parser": "~3.1.1",
|
|
||||||
"to-array": "0.1.4"
|
"to-array": "0.1.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/socket.io-parser": {
|
"node_modules/socket.io-client/node_modules/debug": {
|
||||||
"version": "3.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.3.tgz",
|
|
||||||
"integrity": "sha512-g0a2HPqLguqAczs3dMECuA1RgoGFPyvDqcbaDEdCWY9g59kdUAz3YRmaJBNKXflrHNwB7Q12Gkf/0CZXfdHR7g==",
|
|
||||||
"dependencies": {
|
|
||||||
"component-emitter": "1.2.1",
|
|
||||||
"debug": "~3.1.0",
|
|
||||||
"has-binary2": "~1.0.2",
|
|
||||||
"isarray": "2.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/socket.io-parser/node_modules/debug": {
|
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
||||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
||||||
@ -7117,6 +7046,59 @@
|
|||||||
"ms": "2.0.0"
|
"ms": "2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/socket.io-client/node_modules/socket.io-parser": {
|
||||||
|
"version": "3.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz",
|
||||||
|
"integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==",
|
||||||
|
"dependencies": {
|
||||||
|
"component-emitter": "~1.3.0",
|
||||||
|
"debug": "~3.1.0",
|
||||||
|
"isarray": "2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/socket.io-parser": {
|
||||||
|
"version": "3.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz",
|
||||||
|
"integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==",
|
||||||
|
"dependencies": {
|
||||||
|
"component-emitter": "1.2.1",
|
||||||
|
"debug": "~4.1.0",
|
||||||
|
"isarray": "2.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/socket.io-parser/node_modules/component-emitter": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-jPatnhd33viNplKjqXKRkGU345p263OIWzDL2wH3LGIGp5Kojo+uXizHmOADRvhGFFTnJqX3jBAKP6vvmSDKcA=="
|
||||||
|
},
|
||||||
|
"node_modules/socket.io-parser/node_modules/debug": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)",
|
||||||
|
"dependencies": {
|
||||||
|
"ms": "^2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/socket.io-parser/node_modules/ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
|
},
|
||||||
|
"node_modules/socket.io/node_modules/debug": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"deprecated": "Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)",
|
||||||
|
"dependencies": {
|
||||||
|
"ms": "^2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/socket.io/node_modules/ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
|
},
|
||||||
"node_modules/socks": {
|
"node_modules/socks": {
|
||||||
"version": "2.7.0",
|
"version": "2.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/socks/-/socks-2.7.0.tgz",
|
||||||
@ -7792,11 +7774,6 @@
|
|||||||
"node": ">=4.2.0"
|
"node": ">=4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ultron": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og=="
|
|
||||||
},
|
|
||||||
"node_modules/umd": {
|
"node_modules/umd": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz",
|
||||||
@ -7945,17 +7922,6 @@
|
|||||||
"uuid": "dist/bin/uuid"
|
"uuid": "dist/bin/uuid"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/uws": {
|
|
||||||
"version": "9.14.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/uws/-/uws-9.14.0.tgz",
|
|
||||||
"integrity": "sha512-HNMztPP5A1sKuVFmdZ6BPVpBQd5bUjNC8EFMFiICK+oho/OQsAJy5hnIx4btMHiOk8j04f/DbIlqnEZ9d72dqg==",
|
|
||||||
"deprecated": "New code is available at github.com/uNetworking/uWebSockets.js",
|
|
||||||
"hasInstallScript": true,
|
|
||||||
"optional": true,
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/v8-compile-cache": {
|
"node_modules/v8-compile-cache": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
|
||||||
@ -8120,24 +8086,29 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "3.3.3",
|
"version": "7.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
|
||||||
"integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==",
|
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
||||||
"dependencies": {
|
"engines": {
|
||||||
"async-limiter": "~1.0.0",
|
"node": ">=8.3.0"
|
||||||
"safe-buffer": "~5.1.0",
|
},
|
||||||
"ultron": "~1.1.0"
|
"peerDependencies": {
|
||||||
|
"bufferutil": "^4.0.1",
|
||||||
|
"utf-8-validate": "^5.0.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"bufferutil": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"utf-8-validate": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ws/node_modules/safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
||||||
},
|
|
||||||
"node_modules/xmlhttprequest-ssl": {
|
"node_modules/xmlhttprequest-ssl": {
|
||||||
"version": "1.5.5",
|
"version": "1.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.6.3.tgz",
|
||||||
"integrity": "sha512-/bFPLUgJrfGUL10AIv4Y7/CUt6so9CLtB/oFxQSHseSDNNCdC6vwwKEqwLN6wNPBg9YWXAiMu8jkf6RPRS/75Q==",
|
"integrity": "sha512-3XfeQE/wNkvrIktn2Kf0869fC0BN6UpydVasGIeSm2B1Llihf7/0UfZM+eCkOw3P7bP4+qPgqhm7ZoxuJtFU0Q==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
@ -9294,13 +9265,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.2.3.tgz",
|
||||||
"integrity": "sha512-utbW9Z7ZxVvwiIWkdOMLOR9G/NFXh2aRucghkVrEMJWuC++r3lCkBC3LwqBinyHzGMAJxY5tn6VakZGHObq5ig==",
|
"integrity": "sha512-utbW9Z7ZxVvwiIWkdOMLOR9G/NFXh2aRucghkVrEMJWuC++r3lCkBC3LwqBinyHzGMAJxY5tn6VakZGHObq5ig==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
|
||||||
"ws": {
|
|
||||||
"version": "7.4.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
|
|
||||||
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
|
||||||
"dev": true,
|
|
||||||
"requires": {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -9806,11 +9770,6 @@
|
|||||||
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
|
"integrity": "sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"async-limiter": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ=="
|
|
||||||
},
|
|
||||||
"async-listener": {
|
"async-listener": {
|
||||||
"version": "0.6.10",
|
"version": "0.6.10",
|
||||||
"resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz",
|
"resolved": "https://registry.npmjs.org/async-listener/-/async-listener-0.6.10.tgz",
|
||||||
@ -9861,9 +9820,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"base64-arraybuffer": {
|
"base64-arraybuffer": {
|
||||||
"version": "0.1.5",
|
"version": "0.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.4.tgz",
|
||||||
"integrity": "sha512-437oANT9tP582zZMwSvZGy2nmSeAb8DW2me3y+Uv1Wp2Rulr8Mqlyrv3E7MLxmsiaPSMMDmiDVzgE+e8zlMx9g=="
|
"integrity": "sha512-a1eIFi4R9ySrbiMuyTGx5e92uRH5tQY6kArNcFaKBUleIoLjdjBg7Zxm3Mqm3Kmkf27HLR/1fnxX9q8GQ7Iavg=="
|
||||||
},
|
},
|
||||||
"base64-js": {
|
"base64-js": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
@ -9872,17 +9831,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"base64id": {
|
"base64id": {
|
||||||
"version": "1.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/base64id/-/base64id-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz",
|
||||||
"integrity": "sha512-rz8L+d/xByiB/vLVftPkyY215fqNrmasrcJsYkVcm4TgJNz+YXKrFaFAWibSaHkiKoSgMDCb+lipOIRQNGYesw=="
|
"integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog=="
|
||||||
},
|
|
||||||
"better-assert": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-bYeph2DFlpK1XmGs6fvlLRUN29QISM3GBuUwSFsMY2XRx4AvC0WNCS57j4c/xGrK2RS24C1w3YoBOsw9fT46tQ==",
|
|
||||||
"requires": {
|
|
||||||
"callsite": "1.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"binary-extensions": {
|
"binary-extensions": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
@ -10214,11 +10165,6 @@
|
|||||||
"get-intrinsic": "^1.0.2"
|
"get-intrinsic": "^1.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"callsite": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-0vdNRFXn5q+dtOqjfFtmtlI9N2eVZ7LMyEV2iKC5mEEFvSg/69Ml6b/WU2qF8W1nLRa0wiSrDT3Y5jOHZCwKPQ=="
|
|
||||||
},
|
|
||||||
"callsites": {
|
"callsites": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||||
@ -10344,9 +10290,9 @@
|
|||||||
"integrity": "sha512-WZveuKPeKAG9qY+FkYDeADzdHyTYdIboXS59ixDeRJL5ZhxpqUnxSOwop4FQjMsiYm3/Or8cegVbpAHNA7pHxw=="
|
"integrity": "sha512-WZveuKPeKAG9qY+FkYDeADzdHyTYdIboXS59ixDeRJL5ZhxpqUnxSOwop4FQjMsiYm3/Or8cegVbpAHNA7pHxw=="
|
||||||
},
|
},
|
||||||
"component-emitter": {
|
"component-emitter": {
|
||||||
"version": "1.2.1",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
|
||||||
"integrity": "sha512-jPatnhd33viNplKjqXKRkGU345p263OIWzDL2wH3LGIGp5Kojo+uXizHmOADRvhGFFTnJqX3jBAKP6vvmSDKcA=="
|
"integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg=="
|
||||||
},
|
},
|
||||||
"component-inherit": {
|
"component-inherit": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
@ -10830,49 +10776,53 @@
|
|||||||
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
|
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
|
||||||
},
|
},
|
||||||
"engine.io": {
|
"engine.io": {
|
||||||
"version": "3.1.5",
|
"version": "3.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.6.0.tgz",
|
||||||
"integrity": "sha512-D06ivJkYxyRrcEe0bTpNnBQNgP9d3xog+qZlLbui8EsMr/DouQpf5o9FzJnWYHEYE0YsFHllUv2R1dkgYZXHcA==",
|
"integrity": "sha512-Kc8fo5bbg8F4a2f3HPHTEpGyq/IRIQpyeHu3H1ThR14XDD7VrLcsGBo16HUpahgp8YkHJDaU5gNxJZbuGcuueg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"accepts": "~1.3.4",
|
"accepts": "~1.3.4",
|
||||||
"base64id": "1.0.0",
|
"base64id": "2.0.0",
|
||||||
"cookie": "0.3.1",
|
"cookie": "~0.4.1",
|
||||||
"debug": "~3.1.0",
|
"debug": "~4.1.0",
|
||||||
"engine.io-parser": "~2.1.0",
|
"engine.io-parser": "~2.2.0",
|
||||||
"uws": "~9.14.0",
|
"ws": "~7.4.2"
|
||||||
"ws": "~3.3.1"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cookie": {
|
"cookie": {
|
||||||
"version": "0.3.1",
|
"version": "0.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz",
|
||||||
"integrity": "sha512-+IJOX0OqlHCszo2mBUq+SrEbCj6w7Kpffqx60zYbPTFaO4+yYgRjHwcZNpWvaTylDHaV7PPmBHzSecZiMhtPgw=="
|
"integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA=="
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"version": "3.1.0",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"ms": "2.0.0"
|
"ms": "^2.1.1"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"engine.io-client": {
|
"engine.io-client": {
|
||||||
"version": "3.1.6",
|
"version": "3.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.1.6.tgz",
|
"resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.5.3.tgz",
|
||||||
"integrity": "sha512-hnuHsFluXnsKOndS4Hv6SvUrgdYx1pk2NqfaDMW+GWdgfU3+/V25Cj7I8a0x92idSpa5PIhJRKxPvp9mnoLsfg==",
|
"integrity": "sha512-qsgyc/CEhJ6cgMUwxRRtOndGVhIu5hpL5tR4umSpmX/MvkFoIxUTM7oFMDQumHNzlNLwSVy6qhstFPoWTf7dOw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"component-emitter": "1.2.1",
|
"component-emitter": "~1.3.0",
|
||||||
"component-inherit": "0.0.3",
|
"component-inherit": "0.0.3",
|
||||||
"debug": "~3.1.0",
|
"debug": "~3.1.0",
|
||||||
"engine.io-parser": "~2.1.1",
|
"engine.io-parser": "~2.2.0",
|
||||||
"has-cors": "1.1.0",
|
"has-cors": "1.1.0",
|
||||||
"indexof": "0.0.1",
|
"indexof": "0.0.1",
|
||||||
"parseqs": "0.0.5",
|
"parseqs": "0.0.6",
|
||||||
"parseuri": "0.0.5",
|
"parseuri": "0.0.6",
|
||||||
"ws": "~3.3.1",
|
"ws": "~7.4.2",
|
||||||
"xmlhttprequest-ssl": "~1.5.4",
|
"xmlhttprequest-ssl": "~1.6.2",
|
||||||
"yeast": "0.1.2"
|
"yeast": "0.1.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -10887,13 +10837,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"engine.io-parser": {
|
"engine.io-parser": {
|
||||||
"version": "2.1.3",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.1.tgz",
|
||||||
"integrity": "sha512-6HXPre2O4Houl7c4g7Ic/XzPnHBvaEmN90vtRO9uLmwtRqQmTOw0QMevL1TOfL2Cpu1VzsaTmMotQgMdkzGkVA==",
|
"integrity": "sha512-x+dN/fBH8Ro8TFwJ+rkB2AmuVw9Yu2mockR/p3W8f8YtExwFgDvBDi0GWyb4ZLkpahtDGZgtr3zLovanJghPqg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"after": "0.8.2",
|
"after": "0.8.2",
|
||||||
"arraybuffer.slice": "~0.0.7",
|
"arraybuffer.slice": "~0.0.7",
|
||||||
"base64-arraybuffer": "0.1.5",
|
"base64-arraybuffer": "0.1.4",
|
||||||
"blob": "0.0.5",
|
"blob": "0.0.5",
|
||||||
"has-binary2": "~1.0.2"
|
"has-binary2": "~1.0.2"
|
||||||
}
|
}
|
||||||
@ -11558,11 +11508,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"httpolyglot": {
|
|
||||||
"version": "0.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/httpolyglot/-/httpolyglot-0.1.2.tgz",
|
|
||||||
"integrity": "sha512-ouHI1AaQMLgn4L224527S5+vq6hgvqPteurVfbm7ChViM3He2Wa8KP1Ny7pTYd7QKnDSPKcN8JYfC8r/lmsE3A=="
|
|
||||||
},
|
|
||||||
"https-browserify": {
|
"https-browserify": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
|
||||||
@ -12447,12 +12392,8 @@
|
|||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
|
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
|
||||||
},
|
"dev": true
|
||||||
"object-component": {
|
|
||||||
"version": "0.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz",
|
|
||||||
"integrity": "sha512-S0sN3agnVh2SZNEIGc0N1X4Z5K0JeFbGBrnuZpsxuUh5XLF0BnvWkMjRXo/zGKLd/eghvNIKcx1pQkmUjXIyrA=="
|
|
||||||
},
|
},
|
||||||
"object-inspect": {
|
"object-inspect": {
|
||||||
"version": "1.12.2",
|
"version": "1.12.2",
|
||||||
@ -12671,20 +12612,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parseqs": {
|
"parseqs": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.6.tgz",
|
||||||
"integrity": "sha512-B3Nrjw2aL7aI4TDujOzfA4NsEc4u1lVcIRE0xesutH8kjeWF70uk+W5cBlIQx04zUH9NTBvuN36Y9xLRPK6Jjw==",
|
"integrity": "sha512-jeAGzMDbfSHHA091hr0r31eYfTig+29g3GKKE/PPbEQ65X0lmMwlEoqmhzu0iztID5uJpZsFlUPDP8ThPL7M8w=="
|
||||||
"requires": {
|
|
||||||
"better-assert": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"parseuri": {
|
"parseuri": {
|
||||||
"version": "0.0.5",
|
"version": "0.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.6.tgz",
|
||||||
"integrity": "sha512-ijhdxJu6l5Ru12jF0JvzXVPvsC+VibqeaExlNoMhWN6VQ79PGjkmc7oA4W1lp00sFkNyj0fx6ivPLdV51/UMog==",
|
"integrity": "sha512-AUjen8sAkGgao7UyCX6Ahv0gIK2fABKmYjvP4xmy5JaKvcbTRueIqIPHLAfq30xJddqSE033IOMUSOMCcK3Sow=="
|
||||||
"requires": {
|
|
||||||
"better-assert": "~1.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"parseurl": {
|
"parseurl": {
|
||||||
"version": "1.3.3",
|
"version": "1.3.3",
|
||||||
@ -13464,16 +13399,31 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"socket.io": {
|
"socket.io": {
|
||||||
"version": "2.0.3",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.5.0.tgz",
|
||||||
"integrity": "sha512-qya7+ILKQ9vbXwJ/bUkT5Oe4RCD8c7Z9bZSg3jDDnuNxl+thkzgYz4BB+Oe8hxh1pF2xRbZUnIbrFw7+lpp94w==",
|
"integrity": "sha512-gGunfS0od3VpwDBpGwVkzSZx6Aqo9uOcf1afJj2cKnKFAoyl16fvhpsUhmUFd4Ldbvl5JvRQed6eQw6oQp6n8w==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "~2.6.6",
|
"debug": "~4.1.0",
|
||||||
"engine.io": "~3.1.0",
|
"engine.io": "~3.6.0",
|
||||||
"object-assign": "~4.1.1",
|
"has-binary2": "~1.0.2",
|
||||||
"socket.io-adapter": "~1.1.0",
|
"socket.io-adapter": "~1.1.0",
|
||||||
"socket.io-client": "~2.0.2",
|
"socket.io-client": "2.5.0",
|
||||||
"socket.io-parser": "~3.1.1"
|
"socket.io-parser": "~3.4.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "^2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"socket.io-adapter": {
|
"socket.io-adapter": {
|
||||||
@ -13482,34 +13432,21 @@
|
|||||||
"integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g=="
|
"integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g=="
|
||||||
},
|
},
|
||||||
"socket.io-client": {
|
"socket.io-client": {
|
||||||
"version": "2.0.3",
|
"version": "2.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.5.0.tgz",
|
||||||
"integrity": "sha512-Lx7dCP7xCLKNXB5IB5AH37YoIjxAHLxQxXPFx0uTj9juQAayWUIwS6VS9Qn3I3eESIoQzjvsatAW1w4qb3ek9A==",
|
"integrity": "sha512-lOO9clmdgssDykiOmVQQitwBAF3I6mYcQAo7hQ7AM6Ny5X7fp8hIJ3HcQs3Rjz4SoggoxA1OgrQyY8EgTbcPYw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"backo2": "1.0.2",
|
"backo2": "1.0.2",
|
||||||
"base64-arraybuffer": "0.1.5",
|
|
||||||
"component-bind": "1.0.0",
|
"component-bind": "1.0.0",
|
||||||
"component-emitter": "1.2.1",
|
"component-emitter": "~1.3.0",
|
||||||
"debug": "~2.6.4",
|
|
||||||
"engine.io-client": "~3.1.0",
|
|
||||||
"has-cors": "1.1.0",
|
|
||||||
"indexof": "0.0.1",
|
|
||||||
"object-component": "0.0.3",
|
|
||||||
"parseqs": "0.0.5",
|
|
||||||
"parseuri": "0.0.5",
|
|
||||||
"socket.io-parser": "~3.1.1",
|
|
||||||
"to-array": "0.1.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"socket.io-parser": {
|
|
||||||
"version": "3.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.1.3.tgz",
|
|
||||||
"integrity": "sha512-g0a2HPqLguqAczs3dMECuA1RgoGFPyvDqcbaDEdCWY9g59kdUAz3YRmaJBNKXflrHNwB7Q12Gkf/0CZXfdHR7g==",
|
|
||||||
"requires": {
|
|
||||||
"component-emitter": "1.2.1",
|
|
||||||
"debug": "~3.1.0",
|
"debug": "~3.1.0",
|
||||||
|
"engine.io-client": "~3.5.0",
|
||||||
"has-binary2": "~1.0.2",
|
"has-binary2": "~1.0.2",
|
||||||
"isarray": "2.0.1"
|
"indexof": "0.0.1",
|
||||||
|
"parseqs": "0.0.6",
|
||||||
|
"parseuri": "0.0.6",
|
||||||
|
"socket.io-parser": "~3.3.0",
|
||||||
|
"to-array": "0.1.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"debug": {
|
"debug": {
|
||||||
@ -13519,6 +13456,46 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"ms": "2.0.0"
|
"ms": "2.0.0"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"socket.io-parser": {
|
||||||
|
"version": "3.3.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.2.tgz",
|
||||||
|
"integrity": "sha512-FJvDBuOALxdCI9qwRrO/Rfp9yfndRtc1jSgVgV8FDraihmSP/MLGD5PEuJrNfjALvcQ+vMDM/33AWOYP/JSjDg==",
|
||||||
|
"requires": {
|
||||||
|
"component-emitter": "~1.3.0",
|
||||||
|
"debug": "~3.1.0",
|
||||||
|
"isarray": "2.0.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"socket.io-parser": {
|
||||||
|
"version": "3.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz",
|
||||||
|
"integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==",
|
||||||
|
"requires": {
|
||||||
|
"component-emitter": "1.2.1",
|
||||||
|
"debug": "~4.1.0",
|
||||||
|
"isarray": "2.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"component-emitter": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-jPatnhd33viNplKjqXKRkGU345p263OIWzDL2wH3LGIGp5Kojo+uXizHmOADRvhGFFTnJqX3jBAKP6vvmSDKcA=="
|
||||||
|
},
|
||||||
|
"debug": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "^2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
|
||||||
|
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -14023,11 +14000,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"peer": true
|
"peer": true
|
||||||
},
|
},
|
||||||
"ultron": {
|
|
||||||
"version": "1.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
|
|
||||||
"integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og=="
|
|
||||||
},
|
|
||||||
"umd": {
|
"umd": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz",
|
||||||
@ -14138,12 +14110,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
|
||||||
},
|
},
|
||||||
"uws": {
|
|
||||||
"version": "9.14.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/uws/-/uws-9.14.0.tgz",
|
|
||||||
"integrity": "sha512-HNMztPP5A1sKuVFmdZ6BPVpBQd5bUjNC8EFMFiICK+oho/OQsAJy5hnIx4btMHiOk8j04f/DbIlqnEZ9d72dqg==",
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"v8-compile-cache": {
|
"v8-compile-cache": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz",
|
||||||
@ -14273,26 +14239,15 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "3.3.3",
|
"version": "7.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz",
|
||||||
"integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==",
|
"integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==",
|
||||||
"requires": {
|
"requires": {}
|
||||||
"async-limiter": "~1.0.0",
|
|
||||||
"safe-buffer": "~5.1.0",
|
|
||||||
"ultron": "~1.1.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"safe-buffer": {
|
|
||||||
"version": "5.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
|
||||||
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"xmlhttprequest-ssl": {
|
"xmlhttprequest-ssl": {
|
||||||
"version": "1.5.5",
|
"version": "1.6.3",
|
||||||
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz",
|
"resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.6.3.tgz",
|
||||||
"integrity": "sha512-/bFPLUgJrfGUL10AIv4Y7/CUt6so9CLtB/oFxQSHseSDNNCdC6vwwKEqwLN6wNPBg9YWXAiMu8jkf6RPRS/75Q=="
|
"integrity": "sha512-3XfeQE/wNkvrIktn2Kf0869fC0BN6UpydVasGIeSm2B1Llihf7/0UfZM+eCkOw3P7bP4+qPgqhm7ZoxuJtFU0Q=="
|
||||||
},
|
},
|
||||||
"xregexp": {
|
"xregexp": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
|
@ -5,19 +5,17 @@
|
|||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start:dev": "nodemon app.ts",
|
"start:dev": "nodemon app.js",
|
||||||
"start:prod": "pm2 start ./app.js -n video-server",
|
"start:prod": "pm2 start ./app.js -n video-server",
|
||||||
"watch": "watchify public/index.js -o public/bundle.js -v"
|
"watch": "watchify public/index.js -o public/bundle.js -v"
|
||||||
},
|
},
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"type": "module",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/express": "^4.17.13",
|
"@types/express": "^4.17.13",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"express": "^4.18.1",
|
"express": "^4.18.1",
|
||||||
"httpolyglot": "^0.1.2",
|
|
||||||
"mediasoup": "^3.10.4",
|
"mediasoup": "^3.10.4",
|
||||||
"mediasoup-client": "^3.6.54",
|
"mediasoup-client": "^3.6.54",
|
||||||
"parcel": "^2.7.0",
|
"parcel": "^2.7.0",
|
||||||
|
1539
public/bundle.js
@ -1,5 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
hubAddress: 'https://hub.dev.linx.safemobile.com/',
|
hubAddress: 'https://hub.dev.linx.safemobile.com/',
|
||||||
mediasoupAddress: 'https://video.safemobile.org/mediasoup',
|
mediasoupAddress: 'https://testing.video.safemobile.org/',
|
||||||
// mediasoupAddress: 'http://localhost:3000/mediasoup',
|
|
||||||
}
|
}
|
@ -34,6 +34,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<body>
|
<body>
|
||||||
<div id="video">
|
<div id="video">
|
||||||
|
<legend>Client options:</legend>
|
||||||
|
<input type="checkbox" id="produceAudio" name="produceAudio">
|
||||||
|
<label for="produceAudio">Produce audio</label><br>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<th>Local Video</th>
|
<th>Local Video</th>
|
||||||
@ -43,12 +46,24 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<div id="sharedBtns">
|
<div id="sharedBtns">
|
||||||
<video id="localVideo" autoplay class="video" ></video>
|
<video
|
||||||
|
id="localVideo"
|
||||||
|
class="video"
|
||||||
|
autoplay
|
||||||
|
muted
|
||||||
|
playsinline
|
||||||
|
></video>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="sharedBtns">
|
<div id="sharedBtns">
|
||||||
<video id="remoteVideo" autoplay class="video" ></video>
|
<video
|
||||||
|
id="remoteVideo"
|
||||||
|
class="video"
|
||||||
|
autoplay
|
||||||
|
muted
|
||||||
|
playsinline
|
||||||
|
></video>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -60,34 +75,11 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div id="sharedBtns">
|
<div id="sharedBtns">
|
||||||
<button id="btnRecvSendTransport">Consume</button>
|
<!-- <button id="btnRecvSendTransport">Consume</button> -->
|
||||||
|
<button id="remoteSoundControl">Unmute</button>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<!-- <tr>
|
|
||||||
<td colspan="2">
|
|
||||||
<div id="sharedBtns">
|
|
||||||
<button id="btnRtpCapabilities">2. Get Rtp Capabilities</button>
|
|
||||||
<br />
|
|
||||||
<button id="btnDevice">3. Create Device</button>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<div id="sharedBtns">
|
|
||||||
<button id="btnCreateSendTransport">4. Create Send Transport</button>
|
|
||||||
<br />
|
|
||||||
<button id="btnConnectSendTransport">5. Connect Send Transport & Produce</button></td>
|
|
||||||
</div>
|
|
||||||
<td>
|
|
||||||
<div id="sharedBtns">
|
|
||||||
<button id="btnRecvSendTransport">6. Create Recv Transport</button>
|
|
||||||
<br />
|
|
||||||
<button id="btnConnectRecvTransport">7. Connect Recv Transport & Consume</button>
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
</tr> -->
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div id="closeCallBtn">
|
<div id="closeCallBtn">
|
||||||
|
467
public/index.js
@ -10,147 +10,201 @@ const ASSET_NAME = urlParams.get('assetName') || null;
|
|||||||
const ASSET_TYPE = urlParams.get('assetType') || null;
|
const ASSET_TYPE = urlParams.get('assetType') || null;
|
||||||
let callId = parseInt(urlParams.get('callId')) || null;
|
let callId = parseInt(urlParams.get('callId')) || null;
|
||||||
const IS_PRODUCER = urlParams.get('producer') === 'true' ? true : false
|
const IS_PRODUCER = urlParams.get('producer') === 'true' ? true : false
|
||||||
|
let remoteVideo = document.getElementById('remoteVideo')
|
||||||
|
remoteVideo.defaultMuted = true
|
||||||
|
let produceAudio = false
|
||||||
|
|
||||||
console.log('[URL] ASSET_ID', ASSET_ID, '| ACCOUNT_ID', ACCOUNT_ID, '| callId', callId, ' | IS_PRODUCER', IS_PRODUCER)
|
console.log('[URL] ASSET_ID', ASSET_ID, '| ACCOUNT_ID', ACCOUNT_ID, '| callId', callId, ' | IS_PRODUCER', IS_PRODUCER)
|
||||||
|
|
||||||
let socket
|
console.log('🟩 config', config)
|
||||||
hub = io(config.hubAddress)
|
|
||||||
|
|
||||||
const connectToMediasoup = () => {
|
produceAudioSelector = document.getElementById('produceAudio');
|
||||||
|
produceAudioSelector.addEventListener('change', e => {
|
||||||
socket = io(config.mediasoupAddress, {
|
if(e.target.checked) {
|
||||||
reconnection: true,
|
produceAudio = true
|
||||||
reconnectionDelay: 1000,
|
console.log('produce audio');
|
||||||
reconnectionDelayMax : 5000,
|
} else {
|
||||||
reconnectionAttempts: Infinity
|
produceAudio = false
|
||||||
})
|
|
||||||
|
|
||||||
socket.on('connection-success', ({ _socketId, existsProducer }) => {
|
|
||||||
console.log(`[MEDIA] ${config.mediasoupAddress} | connected: ${socket.connected} | existsProducer: ${existsProducer}`)
|
|
||||||
if (!IS_PRODUCER && existsProducer && consumer === undefined) {
|
|
||||||
goConnect()
|
|
||||||
// document.getElementById('btnRecvSendTransport').click();
|
|
||||||
}
|
}
|
||||||
if (IS_PRODUCER && urlParams.get('testing') === 'true') { getLocalStream() }
|
});
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_PRODUCER === true) {
|
|
||||||
hub.on('connect', async () => {
|
|
||||||
console.log(`[HUB] ${config.hubAddress} | connected: ${hub.connected}`)
|
|
||||||
connectToMediasoup()
|
|
||||||
|
|
||||||
hub.emit(
|
|
||||||
'ars',
|
|
||||||
JSON.stringify({
|
|
||||||
ars: true,
|
|
||||||
asset_id: ASSET_ID,
|
|
||||||
account_id: ACCOUNT_ID,
|
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
hub.on('video', (data) => {
|
|
||||||
const parsedData = JSON.parse(data);
|
|
||||||
|
|
||||||
if (parsedData.type === 'notify-request') {
|
|
||||||
console.log('video', parsedData)
|
|
||||||
originAssetId = parsedData.origin_asset_id;
|
|
||||||
// originAssetName = parsedData.origin_asset_name;
|
|
||||||
// originAssetTypeName = parsedData.origin_asset_type_name;
|
|
||||||
callId = parsedData.video_call_id;
|
|
||||||
|
|
||||||
console.log('[VIDEO] notify-request | IS_PRODUCER', IS_PRODUCER, 'callId', callId);
|
|
||||||
getLocalStream()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parsedData.type === 'notify-end') {
|
|
||||||
console.log('[VIDEO] notify-end | IS_PRODUCER', IS_PRODUCER, 'callId', callId);
|
|
||||||
resetCallSettings()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
hub.on('connect_error', (error) => {
|
|
||||||
console.log('connect_error', error);
|
|
||||||
});
|
|
||||||
|
|
||||||
hub.on('connection', () => {
|
|
||||||
console.log('connection')
|
|
||||||
})
|
|
||||||
|
|
||||||
hub.on('disconnect', () => {
|
|
||||||
console.log('disconnect')
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
connectToMediasoup()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
let socket, hub
|
||||||
let device
|
let device
|
||||||
let rtpCapabilities
|
let rtpCapabilities
|
||||||
let producerTransport
|
let producerTransport
|
||||||
let consumerTransport
|
let consumerTransport
|
||||||
let producer
|
let producerVideo
|
||||||
|
let producerAudio
|
||||||
let consumer
|
let consumer
|
||||||
let originAssetId
|
let originAssetId
|
||||||
// let originAssetName = 'Adi'
|
let consumerVideo // local consumer video(consumer not transport)
|
||||||
// let originAssetTypeName = 'linx'
|
let consumerAudio // local consumer audio(consumer not transport)
|
||||||
|
|
||||||
|
const remoteSoundControl = document.getElementById('remoteSoundControl');
|
||||||
|
|
||||||
|
remoteSoundControl.addEventListener('click', function handleClick() {
|
||||||
|
console.log('remoteSoundControl.textContent', remoteSoundControl.textContent);
|
||||||
|
if (remoteSoundControl.textContent === 'Unmute') {
|
||||||
|
remoteVideo.muted = false
|
||||||
|
remoteSoundControl.textContent = 'Mute';
|
||||||
|
} else {
|
||||||
|
remoteVideo.muted = true
|
||||||
|
remoteSoundControl.textContent = 'Unmute';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerOptions
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
||||||
let params = {
|
let videoParams = {
|
||||||
// mediasoup params
|
|
||||||
encodings: [
|
encodings: [
|
||||||
{
|
{ scaleResolutionDownBy: 4, maxBitrate: 500000 },
|
||||||
rid: 'r0',
|
{ scaleResolutionDownBy: 2, maxBitrate: 1000000 },
|
||||||
maxBitrate: 100000,
|
{ scaleResolutionDownBy: 1, maxBitrate: 5000000 },
|
||||||
scalabilityMode: 'S1T3',
|
{ scalabilityMode: 'S3T3_KEY' }
|
||||||
},
|
|
||||||
{
|
|
||||||
rid: 'r1',
|
|
||||||
maxBitrate: 300000,
|
|
||||||
scalabilityMode: 'S1T3',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
rid: 'r2',
|
|
||||||
maxBitrate: 900000,
|
|
||||||
scalabilityMode: 'S1T3',
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#ProducerCodecOptions
|
|
||||||
codecOptions: {
|
codecOptions: {
|
||||||
videoGoogleStartBitrate: 1000
|
videoGoogleStartBitrate: 1000
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const streamSuccess = (stream) => {
|
let audioParams = {
|
||||||
console.log('[streamSuccess]');
|
codecOptions :
|
||||||
localVideo.srcObject = stream
|
{
|
||||||
const track = stream.getVideoTracks()[0]
|
opusStereo : true,
|
||||||
params = {
|
opusDtx : true
|
||||||
track,
|
|
||||||
...params
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
hub = io(config.hubAddress)
|
||||||
|
|
||||||
|
const connectToMediasoup = () => {
|
||||||
|
|
||||||
|
socket = io(config.mediasoupAddress, {
|
||||||
|
reconnection: true,
|
||||||
|
reconnectionDelay: 1000,
|
||||||
|
reconnectionDelayMax : 5000,
|
||||||
|
reconnectionAttempts: Infinity
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.on('connection-success', ({ _socketId, existsProducer }) => {
|
||||||
|
console.log(`[MEDIA] ${config.mediasoupAddress} | connected: ${socket.connected} | existsProducer: ${existsProducer}`)
|
||||||
|
if (!IS_PRODUCER && existsProducer && consumer === undefined) {
|
||||||
|
goConnect()
|
||||||
|
}
|
||||||
|
if (IS_PRODUCER && urlParams.get('testing') === 'true') { getLocalStream() }
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.on('new-producer', ({ callId, kind }) => {
|
||||||
|
console.log(`🟢 new-producer | callId: ${callId} | kind: ${kind} | Ready to consume`);
|
||||||
|
connectRecvTransport();
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.on('close-producer', ({ callId, kind }) => {
|
||||||
|
console.log(`🔴 close-producer | callId: ${callId} | kind: ${kind}`);
|
||||||
|
if (kind === 'video') {
|
||||||
|
consumerVideo.close()
|
||||||
|
remoteVideo.srcObject = null
|
||||||
|
}
|
||||||
|
else if (kind === 'audio') consumerAudio.close()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IS_PRODUCER === true) {
|
||||||
|
hub.on('connect', async () => {
|
||||||
|
console.log(`[HUB]! ${config.hubAddress} | connected: ${hub.connected}`)
|
||||||
|
connectToMediasoup()
|
||||||
|
|
||||||
|
hub.emit(
|
||||||
|
'ars',
|
||||||
|
JSON.stringify({
|
||||||
|
ars: true,
|
||||||
|
asset_id: ASSET_ID,
|
||||||
|
account_id: ACCOUNT_ID,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
hub.on('video', (data) => {
|
||||||
|
const parsedData = JSON.parse(data);
|
||||||
|
|
||||||
|
if (parsedData.type === 'notify-request') {
|
||||||
|
console.log('video', parsedData)
|
||||||
|
originAssetId = parsedData.origin_asset_id;
|
||||||
|
// originAssetName = parsedData.origin_asset_name;
|
||||||
|
// originAssetTypeName = parsedData.origin_asset_type_name;
|
||||||
|
callId = parsedData.video_call_id;
|
||||||
|
|
||||||
|
console.log('[VIDEO] notify-request | IS_PRODUCER', IS_PRODUCER, 'callId', callId);
|
||||||
|
getLocalStream()
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parsedData.type === 'notify-end') {
|
||||||
|
console.log('[VIDEO] notify-end | IS_PRODUCER', IS_PRODUCER, 'callId', callId);
|
||||||
|
resetCallSettings()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
hub.on('connect_error', (error) => {
|
||||||
|
console.log('connect_error', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
hub.on('connection', () => {
|
||||||
|
console.log('connection')
|
||||||
|
})
|
||||||
|
|
||||||
|
hub.on('disconnect', () => {
|
||||||
|
console.log('disconnect')
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
connectToMediasoup()
|
||||||
|
}
|
||||||
|
|
||||||
|
}, 1600);
|
||||||
|
|
||||||
|
const streamSuccess = (stream) => {
|
||||||
|
console.log('[streamSuccess] device', device);
|
||||||
|
localVideo.srcObject = stream
|
||||||
|
console.log('stream', stream);
|
||||||
|
const videoTrack = stream.getVideoTracks()[0]
|
||||||
|
const audioTrack = stream.getAudioTracks()[0]
|
||||||
|
|
||||||
|
videoParams = {
|
||||||
|
track: videoTrack,
|
||||||
|
...videoParams
|
||||||
|
}
|
||||||
|
|
||||||
|
audioParams = {
|
||||||
|
track: audioTrack,
|
||||||
|
...audioParams
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('[streamSuccess] videoParams', videoParams, ' | audioParams', audioParams);
|
||||||
goConnect()
|
goConnect()
|
||||||
}
|
}
|
||||||
|
|
||||||
const getLocalStream = () => {
|
const getLocalStream = () => {
|
||||||
console.log('[getLocalStream]');
|
console.log('[getLocalStream]');
|
||||||
navigator.mediaDevices.getUserMedia({
|
navigator.mediaDevices.getUserMedia({
|
||||||
audio: false,
|
audio: produceAudio ? true : false,
|
||||||
video: {
|
video: {
|
||||||
width: {
|
qvga : { width: { ideal: 320 }, height: { ideal: 240 } },
|
||||||
min: 640,
|
vga : { width: { ideal: 640 }, height: { ideal: 480 } },
|
||||||
max: 1920,
|
hd : { width: { ideal: 1280 }, height: { ideal: 720 } }
|
||||||
},
|
|
||||||
height: {
|
|
||||||
min: 400,
|
|
||||||
max: 1080,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(streamSuccess)
|
.then(streamSuccess)
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.log(error.message)
|
console.log(error.message)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
navigator.permissions.query(
|
||||||
|
{ name: 'microphone' }
|
||||||
|
).then((permissionStatus) =>{
|
||||||
|
console.log('🟨 [PERMISSION] permissionStatus', permissionStatus); // granted, denied, prompt
|
||||||
|
// It will block the code from execution and display "Permission denied" if we don't have microphone permissions
|
||||||
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const goConnect = () => {
|
const goConnect = () => {
|
||||||
@ -167,7 +221,6 @@ const goCreateTransport = () => {
|
|||||||
// server side to send/recive media
|
// server side to send/recive media
|
||||||
const createDevice = async () => {
|
const createDevice = async () => {
|
||||||
try {
|
try {
|
||||||
console.log('[createDevice]');
|
|
||||||
device = new mediasoupClient.Device()
|
device = new mediasoupClient.Device()
|
||||||
|
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#device-load
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#device-load
|
||||||
@ -178,7 +231,8 @@ const createDevice = async () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
console.log('Device RTP Capabilities', device.rtpCapabilities)
|
console.log('Device RTP Capabilities', device.rtpCapabilities)
|
||||||
|
console.log('[createDevice] device', device);
|
||||||
|
|
||||||
// once the device loads, create transport
|
// once the device loads, create transport
|
||||||
goCreateTransport()
|
goCreateTransport()
|
||||||
|
|
||||||
@ -207,18 +261,20 @@ const getRtpCapabilities = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const createSendTransport = () => {
|
const createSendTransport = () => {
|
||||||
|
console.log('[createSendTransport');
|
||||||
// see server's socket.on('createWebRtcTransport', sender?, ...)
|
// see server's socket.on('createWebRtcTransport', sender?, ...)
|
||||||
// this is a call from Producer, so sender = true
|
// this is a call from Producer, so sender = true
|
||||||
socket.emit('createWebRtcTransport', { sender: true, callId }, ({ params }) => {
|
socket.emit('createWebRtcTransport', { sender: true }, (value) => {
|
||||||
|
|
||||||
|
console.log(`[createWebRtcTransport] value: ${JSON.stringify(value)}`);
|
||||||
|
|
||||||
|
const params = value.params;
|
||||||
// The server sends back params needed
|
// The server sends back params needed
|
||||||
// to create Send Transport on the client side
|
// to create Send Transport on the client side
|
||||||
if (params.error) {
|
if (params.error) {
|
||||||
console.log(params.error)
|
console.log(params.error)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(params)
|
|
||||||
|
|
||||||
// creates a new WebRTC Transport to send media
|
// creates a new WebRTC Transport to send media
|
||||||
// based on the server's producer transport params
|
// based on the server's producer transport params
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#TransportOptions
|
||||||
@ -244,10 +300,10 @@ const createSendTransport = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
producerTransport.on('produce', async (parameters, callback, errback) => {
|
producerTransport.on('produce', async (parameters, callback, errback) => {
|
||||||
console.log(parameters)
|
console.log('[produce] parameters', parameters)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// tell the server to create a Producer
|
// Tell the server to create a Producer
|
||||||
// with the following parameters and produce
|
// with the following parameters and produce
|
||||||
// and expect back a server side producer id
|
// and expect back a server side producer id
|
||||||
// see server's socket.on('transport-produce', ...)
|
// see server's socket.on('transport-produce', ...)
|
||||||
@ -270,21 +326,45 @@ const createSendTransport = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const connectSendTransport = async () => {
|
const connectSendTransport = async () => {
|
||||||
// we now call produce() to instruct the producer transport
|
|
||||||
|
console.log('[connectSendTransport] producerTransport');
|
||||||
|
|
||||||
|
// We now call produce() to instruct the producer transport
|
||||||
// to send media to the Router
|
// to send media to the Router
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#transport-produce
|
||||||
// this action will trigger the 'connect' and 'produce' events above
|
// this action will trigger the 'connect' and 'produce' events above
|
||||||
producer = await producerTransport.produce(params)
|
|
||||||
|
// Produce video
|
||||||
|
let producerVideoHandler = await producerTransport.produce(videoParams)
|
||||||
|
console.log('videoParams', videoParams);
|
||||||
|
console.log('producerVideo', producerVideo);
|
||||||
|
|
||||||
producer.on('trackended', () => {
|
producerVideoHandler.on('trackended', () => {
|
||||||
console.log('track ended')
|
console.log('track ended')
|
||||||
// close video track
|
// close video track
|
||||||
})
|
})
|
||||||
|
|
||||||
producer.on('transportclose', () => {
|
producerVideoHandler.on('transportclose', () => {
|
||||||
console.log('transport ended')
|
console.log('transport ended')
|
||||||
// close video track
|
// close video track
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Produce audio
|
||||||
|
if (produceAudio) {
|
||||||
|
let producerAudioHandler = await producerTransport.produce(audioParams)
|
||||||
|
console.log('audioParams', audioParams);
|
||||||
|
console.log('producerAudio', producerAudio);
|
||||||
|
|
||||||
|
producerAudioHandler.on('trackended', () => {
|
||||||
|
console.log('track ended')
|
||||||
|
// close audio track
|
||||||
|
})
|
||||||
|
|
||||||
|
producerAudioHandler.on('transportclose', () => {
|
||||||
|
console.log('transport ended')
|
||||||
|
// close audio track
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
const answer = {
|
const answer = {
|
||||||
origin_asset_id: ASSET_ID,
|
origin_asset_id: ASSET_ID,
|
||||||
@ -294,7 +374,7 @@ const connectSendTransport = async () => {
|
|||||||
origin_asset_type_name: ASSET_TYPE,
|
origin_asset_type_name: ASSET_TYPE,
|
||||||
origin_asset_name: ASSET_NAME,
|
origin_asset_name: ASSET_NAME,
|
||||||
video_call_id: callId,
|
video_call_id: callId,
|
||||||
answer: 'accepted', // answer: 'rejected'
|
answer: 'accepted', // answer: accepted/rejected
|
||||||
};
|
};
|
||||||
console.log('SEND answer', answer);
|
console.log('SEND answer', answer);
|
||||||
|
|
||||||
@ -306,11 +386,13 @@ const connectSendTransport = async () => {
|
|||||||
// Enable Close call button
|
// Enable Close call button
|
||||||
const closeCallBtn = document.getElementById('btnCloseCall');
|
const closeCallBtn = document.getElementById('btnCloseCall');
|
||||||
closeCallBtn.removeAttribute('disabled');
|
closeCallBtn.removeAttribute('disabled');
|
||||||
|
|
||||||
|
createRecvTransport();
|
||||||
}
|
}
|
||||||
|
|
||||||
const createRecvTransport = async () => {
|
const createRecvTransport = async () => {
|
||||||
console.log('createRecvTransport');
|
console.log('createRecvTransport');
|
||||||
// see server's socket.on('consume', sender?, ...)
|
// See server's socket.on('consume', sender?, ...)
|
||||||
// this is a call from Consumer, so sender = false
|
// this is a call from Consumer, so sender = false
|
||||||
await socket.emit('createWebRtcTransport', { sender: false, callId }, ({ params }) => {
|
await socket.emit('createWebRtcTransport', { sender: false, callId }, ({ params }) => {
|
||||||
// The server sends back params needed
|
// The server sends back params needed
|
||||||
@ -320,15 +402,15 @@ const createRecvTransport = async () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(params)
|
console.log('[createRecvTransport] params', params)
|
||||||
|
|
||||||
// creates a new WebRTC Transport to receive media
|
// Creates a new WebRTC Transport to receive media
|
||||||
// based on server's consumer transport params
|
// based on server's consumer transport params
|
||||||
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#device-createRecvTransport
|
// https://mediasoup.org/documentation/v3/mediasoup-client/api/#device-createRecvTransport
|
||||||
consumerTransport = device.createRecvTransport(params)
|
consumerTransport = device.createRecvTransport(params)
|
||||||
|
|
||||||
// https://mediasoup.org/documentation/v3/communication-between-client-and-server/#producing-media
|
// https://mediasoup.org/documentation/v3/communication-between-client-and-server/#producing-media
|
||||||
// this event is raised when a first call to transport.produce() is made
|
// This event is raised when a first call to transport.produce() is made
|
||||||
// see connectRecvTransport() below
|
// see connectRecvTransport() below
|
||||||
consumerTransport.on('connect', async ({ dtlsParameters }, callback, errback) => {
|
consumerTransport.on('connect', async ({ dtlsParameters }, callback, errback) => {
|
||||||
try {
|
try {
|
||||||
@ -345,7 +427,8 @@ const createRecvTransport = async () => {
|
|||||||
errback(error)
|
errback(error)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
connectRecvTransport()
|
// We call it in new-rpoducer, we don't need it here anymore
|
||||||
|
// connectRecvTransport()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,7 +436,8 @@ const resetCallSettings = () => {
|
|||||||
localVideo.srcObject = null
|
localVideo.srcObject = null
|
||||||
remoteVideo.srcObject = null
|
remoteVideo.srcObject = null
|
||||||
consumer = null
|
consumer = null
|
||||||
producer = null
|
producerVideo = null
|
||||||
|
producerAudio = null
|
||||||
producerTransport = null
|
producerTransport = null
|
||||||
consumerTransport = null
|
consumerTransport = null
|
||||||
device = undefined
|
device = undefined
|
||||||
@ -361,40 +445,97 @@ const resetCallSettings = () => {
|
|||||||
|
|
||||||
const connectRecvTransport = async () => {
|
const connectRecvTransport = async () => {
|
||||||
console.log('connectRecvTransport');
|
console.log('connectRecvTransport');
|
||||||
// for consumer, we need to tell the server first
|
// For consumer, we need to tell the server first
|
||||||
// to create a consumer based on the rtpCapabilities and consume
|
// to create a consumer based on the rtpCapabilities and consume
|
||||||
// if the router can consume, it will send back a set of params as below
|
// if the router can consume, it will send back a set of params as below
|
||||||
await socket.emit('consume', {
|
await socket.emit('consume', {
|
||||||
rtpCapabilities: device.rtpCapabilities,
|
rtpCapabilities: device.rtpCapabilities,
|
||||||
callId
|
callId
|
||||||
}, async ({ params }) => {
|
}, async ({videoParams, audioParams}) => {
|
||||||
if (params.error) {
|
console.log(`[consume] 🟩 videoParams`, videoParams)
|
||||||
console.log('Cannot Consume')
|
console.log(`[consume] 🟩 audioParams`, audioParams)
|
||||||
return
|
console.log('[consume] 🟩 consumerTransport', consumerTransport)
|
||||||
}
|
|
||||||
|
|
||||||
// then consume with the local consumer transport
|
|
||||||
// which creates a consumer
|
|
||||||
consumer = await consumerTransport.consume({
|
|
||||||
id: params.id,
|
|
||||||
producerId: params.producerId,
|
|
||||||
kind: params.kind,
|
|
||||||
rtpParameters: params.rtpParameters
|
|
||||||
})
|
|
||||||
|
|
||||||
// destructure and retrieve the video track from the producer
|
|
||||||
const { track } = consumer
|
|
||||||
|
|
||||||
let stream = new MediaStream()
|
let stream = new MediaStream()
|
||||||
stream.addTrack(track)
|
|
||||||
// stream.removeTrack(track)
|
|
||||||
remoteVideo.srcObject = stream
|
|
||||||
socket.emit('consumer-resume')
|
|
||||||
console.log('consumer', consumer);
|
|
||||||
|
|
||||||
|
// Maybe the unit does not produce video or audio, so we must only consume what is produced
|
||||||
|
if (videoParams) {
|
||||||
|
console.log('❗ Have VIDEO stream to consume');
|
||||||
|
stream.addTrack(await getVideoTrask(videoParams))
|
||||||
|
} else {
|
||||||
|
console.log('❗ Don\'t have VIDEO stream to consume');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (audioParams) {
|
||||||
|
console.log('❗ Have AUDIO stream to consume');
|
||||||
|
let audioTrack = await getAudioTrask(audioParams)
|
||||||
|
stream.addTrack(audioTrack)
|
||||||
|
} else {
|
||||||
|
console.log('❗ Don\'t have AUDIO stream to consume');
|
||||||
|
}
|
||||||
|
|
||||||
|
socket.emit('consumer-resume')
|
||||||
|
|
||||||
|
remoteVideo.srcObject = stream
|
||||||
|
remoteVideo.setAttribute('autoplay', true)
|
||||||
|
|
||||||
|
remoteVideo.play()
|
||||||
|
.then(() => {
|
||||||
|
console.log('remoteVideo PLAY')
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(`remoteVideo PLAY ERROR | ${error.message}`)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getVideoTrask = async (videoParams) => {
|
||||||
|
consumerVideo = await consumerTransport.consume({
|
||||||
|
id: videoParams.id,
|
||||||
|
producerId: videoParams.producerId,
|
||||||
|
kind: videoParams.kind,
|
||||||
|
rtpParameters: videoParams.rtpParameters
|
||||||
|
})
|
||||||
|
|
||||||
|
return consumerVideo.track
|
||||||
|
}
|
||||||
|
|
||||||
|
const getAudioTrask = async (audioParams) => {
|
||||||
|
consumerAudio = await consumerTransport.consume({
|
||||||
|
id: audioParams.id,
|
||||||
|
producerId: audioParams.producerId,
|
||||||
|
kind: audioParams.kind,
|
||||||
|
rtpParameters: audioParams.rtpParameters
|
||||||
|
})
|
||||||
|
|
||||||
|
consumerAudio.on('transportclose', () => {
|
||||||
|
console.log('transport closed so consumer closed')
|
||||||
|
})
|
||||||
|
|
||||||
|
const audioTrack = consumerAudio.track
|
||||||
|
|
||||||
|
audioTrack.applyConstraints({
|
||||||
|
audio: {
|
||||||
|
advanced: [
|
||||||
|
{
|
||||||
|
echoCancellation: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
autoGainControl: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
noiseSuppression: {exact: true}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
highpassFilter: {exact: true}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return audioTrack
|
||||||
|
}
|
||||||
|
|
||||||
const closeCall = () => {
|
const closeCall = () => {
|
||||||
console.log('closeCall');
|
console.log('closeCall');
|
||||||
|
|
||||||
@ -416,6 +557,30 @@ const closeCall = () => {
|
|||||||
resetCallSettings()
|
resetCallSettings()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// const consume = async (kind) => {
|
||||||
|
// console.log(`[consume] kind: ${kind}`)
|
||||||
|
// console.log('createRecvTransport Consumer')
|
||||||
|
// await socket.emit('createWebRtcTransport', { sender: false, callId, dispatcher: true }, ({ params }) => {
|
||||||
|
// if (params.error) {
|
||||||
|
// console.log('createRecvTransport | createWebRtcTransport | Error', params.error)
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
// consumerTransport = device.createRecvTransport(params)
|
||||||
|
// consumerTransport.on('connect', async ({ dtlsParameters }, callback, errback) => {
|
||||||
|
// try {
|
||||||
|
// await socket.emit('transport-recv-connect', {
|
||||||
|
// dtlsParameters,
|
||||||
|
// })
|
||||||
|
// callback()
|
||||||
|
// } catch (error) {
|
||||||
|
// errback(error)
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
// connectRecvTransport()
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
btnLocalVideo.addEventListener('click', getLocalStream)
|
btnLocalVideo.addEventListener('click', getLocalStream)
|
||||||
btnRecvSendTransport.addEventListener('click', goConnect)
|
// btnRecvSendTransport.addEventListener('click', consume)
|
||||||
btnCloseCall.addEventListener('click', closeCall)
|
btnCloseCall.addEventListener('click', closeCall)
|