60 lines
2.6 KiB
Markdown
60 lines
2.6 KiB
Markdown
# 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
|
|
|
|
##### To start in development mode you must:
|
|
|
|
1. Install the dependencies `npm install`.
|
|
|
|
2. Go to the `linx-devops/scaling-tools/private-system-truste-cert` project and generate a new server certificate and key:
|
|
|
|
sh create_certificate_for_domain.sh 192.168.1.110 #local IP
|
|
# generates files
|
|
nginx-selfsigned.crt
|
|
device.key
|
|
|
|
3. You need to update the Video Server in the provisioning to point to your private IP. ex: https://192.168.1.199:3000
|
|
|
|
4. The generated files must be moved to server/ssl and renamed as follows:
|
|
|
|
cp device.key {mediasoup_project}/server/ssl/key.pem
|
|
cp nginx-selfsigned.crt {mediosup_project}/server/ssl/cert.pem
|
|
|
|
5. Go to https://dev.linx.safemobile.com/dispatcher/resources/help/LINXHelp.html#safemobile-certificate-import and import the certificate for your system type
|
|
|
|
6. The ANNOUNCED IP in .env must be configured to use the same private IP used in generating the certificate.
|
|
|
|
7. Run the `npm start:dev` command to start the server in dev mode.
|
|
(Any change will trigger a refresh of the server)
|
|
|
|
### Production
|
|
|
|
##### To start in production mode you must:
|
|
1. Install the dependencies `npm install`.
|
|
2. Run the `npm start:prod` command to start the server in production mode.
|
|
(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 web client can be accessed using the /sfu path
|
|
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
|
|
accountId = account id of the unit on which you are doing the test
|
|
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)
|
|
assetName = asset name 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`
|