{"id":26802441,"url":"https://github.com/red5pro/nodejs-mixer-backend","last_synced_at":"2025-03-29T21:18:06.914Z","repository":{"id":41127565,"uuid":"438787726","full_name":"red5pro/nodejs-mixer-backend","owner":"red5pro","description":null,"archived":false,"fork":false,"pushed_at":"2023-02-15T16:51:27.000Z","size":69,"stargazers_count":0,"open_issues_count":1,"forks_count":2,"subscribers_count":9,"default_branch":"main","last_synced_at":"2024-04-15T00:13:12.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/red5pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-12-15T22:14:25.000Z","updated_at":"2022-02-02T13:42:07.000Z","dependencies_parsed_at":"2022-09-08T05:20:33.119Z","dependency_job_id":null,"html_url":"https://github.com/red5pro/nodejs-mixer-backend","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fnodejs-mixer-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fnodejs-mixer-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fnodejs-mixer-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/red5pro%2Fnodejs-mixer-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/red5pro","download_url":"https://codeload.github.com/red5pro/nodejs-mixer-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246243522,"owners_count":20746312,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-29T21:18:06.315Z","updated_at":"2025-03-29T21:18:06.908Z","avatar_url":"https://github.com/red5pro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Red5 Pro Mixer Back-End\n\n\u003e Simple WebSocket Server for hosting Mixer Backend\n\nThis Node.js-based WebSocket server provides the communication between the Stream Manager Mixer testbeds, which moderators use 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 a Manager or Host can add or remove live streams in real time. Additionally, the node.js server can provide the endpoints for round-trip authentication if used.\n\n# Requirements\n\n* NodeJS v10+\n* NPM 6+\n\n\u003e This project was developed with the latest NodeJS \u0026 NPM as of the time of this writing (December 2021).\n\n# Installation\n\n**Install Prerequisites**\n\n```sh\nsudo apt-get update\ncurl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh\nsudo bash nodesource_setup.sh\nsudo apt-get install -y nodejs\nsudo apt-get install build-essential\nsudo npm install forever -g\n```\n\ncd into the project directory, then run:\n\n```sh\nnpm install\n```\n\n# SSL\n\nFor most NodeJS implementations, it is necessary to generate SSL certificate files, which are converted into .crt and .key files to be stored in the `\u003cservice\u003e/cert` folder.\n\n## Using Let's Encrypt\n\nThe following can be run to install Let's Encrypt Certbot on Ubuntu (`snap` is included with most Ubuntu distributions by default)\n\n1.\tsudo snap install core; sudo snap refresh core\n2.\tsudo snap install --classic certbot\n3.\tsudo ln -s /snap/bin/certbot /usr/bin/certbot\n\nTo generate the cert, run `sudo certbot certonly --standalone --email \u003cyour-email\u003e --agree-tos -d \u003cserver-fqdn\u003e`  (for example: `sudo certbot certonly --standalone --email jessica@infrared5.com --agree-tos -d test01.red5.net`)\n\nYou will then need to copy the fullchain and privatekey to the cert directory of your application\n\n```sh\nsudo cp /etc/letsencrypt/live/\u003cserver-fqdn\u003e/fullchain.pem ~/\u003cnodejs-server\u003e/cert/certificate.crt\nsudo cp /etc/letsencrypt/live/\u003cserver-fqdn\u003e/privkey.pem ~/\u003cnodejs-server\u003e/cert/privateKey.key\nsudo chmod +r ~/\u003cnodejs-server\u003e/cert/*\n```\n\nYour index.js file then needs to be modified with the full path to the certificate and privateKey files (replace with the appropriate paths):\n\n```js\nif (useSSL) {\n  cert = fs.readFileSync('/home/ubuntu/serverapp/cert/certificate.crt')\n  key = fs.readFileSync('/home/ubuntu/serverapp/cert/privateKey.key')\n  port = 443\n```\n\n# Usage\n\n***NOTE***\nThere are multiple `index.js` files. The upper level `index.js` does not support the **Grid Composition Test**. To support this test, `cd` to `~/nodejs-mixer-backend/backend-mixer-testbeds`\n\nStart the Node.js server with the following command:\n\n```sh\nsudo PORT=443 SM_TOKEN=\u003cSM-API_token\u003e SM_HOST=https://\u003cHostname-of-Stream-Manager\u003e CERT=\u003cpath-to-fullchain.pem\u003e KEY=\u003cpath-to-fullchain.pem\u003e forever start -w index.js\n```\n\n\u003e By default, if PORT is not specified, the websocket server will run on `localhost:8001`.\n\n## Backend Mixer Testbeds\n\nThe `backend-mixer-testbeds` directory is required for creating mixer compositions.\n\n## Forever Commands\n\n* `forever list`: displays any running forever processes.\n* `forever start`: starts a script as a daemon.\n* `forever stop`: stops the daemon script by `Id|Uid|Pid|Index|Script`.\n* `forever stopall`: stops all running scripts.\n* `forever restart`: restarts the daemon script.\n* `forever restartall`: restarts all running forever scripts.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred5pro%2Fnodejs-mixer-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fred5pro%2Fnodejs-mixer-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fred5pro%2Fnodejs-mixer-backend/lists"}