/

Deploying the Mixer Backend


The Node.js based WebSocket server provides the communication between the Stream Manager Mixer testbeds, which are used by moderators to create compositions, and the HTML5 pages with sample layouts that are loaded into Red5 Pro Mixers and are responsible for defining the layout of the composite streams. This allows for creating dynamic compositions or video conferences where live streams can be added or removed in real-time by a Manager or Host. Finally, the node.js server provides the endpoints for the round trip authentication, if used.

Deploying The Node.js Backend Server

The Node.js Backend For Mixer Testbeds must be deployed on a dedicated instance.

Node.js can be installed on the instance using the following commands:

$ sudo apt-get update
$ curl -sL https://deb.nodesource.com/setup_12.x -o nodesource_setup.sh
$ sudo bash nodesource_setup.sh
$ sudo apt-get install -y nodejs
$ sudo apt-get install build-essential
$ sudo npm install forever -g

Clone the mixer back end

git clone https://github.com/red5pro/nodejs-mixer-backend

Change directories into nodejs-mixer-backend, and install the dependencies as follows:

npm install

Generate a certificate for the server to use.

Start the Node.js server with the following command:

sudo PORT=443 SM_TOKEN=<SM-API_token> SM_HOST=https://<Hostname-of-Stream-Manager> CERT=<path-to-fullchain.pem> KEY=<path-to-private-key.pem> forever start index.js 

By default, if PORT is not specified, the websocket server will run on localhost:8001.