Git Product home page Git Product logo

mediasoup-demo's Introduction

mediasoup-demo v3

A demo application of mediasoup v3.

Try it online at https://v3demo.mediasoup.org.

Resources

Installation

  • Clone the project:
$ git clone https://github.com/versatica/mediasoup-demo.git
$ cd mediasoup-demo
$ git checkout v3
  • Ensure you have installed the dependencies required by mediasoup to build.

  • Set up the mediasoup-demo server:

$ cd server
$ npm install
  • Copy config.example.js as config.js and customize it for your scenario:
$ cp config.example.js config.js

NOTE: To be perfectly clear, "customize it for your scenario" is not something "optional". If you don't set proper values in config.js the application won't work.

  • Set up the mediasoup-demo browser app:
$ cd app
$ npm install

Run it locally

  • Run the Node.js server application in a terminal:
$ cd server
$ npm start
  • In a different terminal build and run the browser application:
$ cd app
$ npm start
  • Enjoy.

Deploy it in a server

  • Globally install gulp-cli NPM module (may need sudo):
$ npm install -g gulp-cli
  • Build the production ready browser application:
$ cd app
$ gulp dist
  • Upload the entire server folder to your server and make your web server (Apache, Nginx, etc) expose the server/public folder.

  • Edit your server/config.js with appropriate settings (listening IP/port, logging options, valid TLS certificate, etc).

  • Within your server, run the Node.js application by setting the DEBUG environment variable according to your needs (more info):

$ DEBUG="*mediasoup* *ERROR* *WARN*" node server.js
  • If you wish to run it as daemon/service you can use pm2 process manager. Or you can dockerize it among other options.

  • The Node.js application exposes an interactive terminal. When running as daemon (in background) the host administrator can connect to it by entering into the server folder and running:

$ npm run connect

Run mediasoup server with Docker

$ cd server
$ docker/build.sh
$ MEDIASOUP_ANNOUNCED_IP=192.168.1.34 ./docker/run.sh

Considerations for (config.js)[server/config.example.js]

  • Make sure https.listenIp is set to 0.0.0.0.
  • Make sure TLS certificates reside in server/certs directory with names fullchain.pem and privkey.pem.
  • The default mediasoup port range is just 2000-2020, which is not suitable for production. You should increase it, however you should then run the container in network="host" mode.

Authors

License

MIT

mediasoup-demo's People

Contributors

ibc avatar jmillan avatar skubarenko avatar scaret avatar havfo avatar muokicaleb avatar namnm avatar realnumber avatar vpalmisano avatar weichun0911 avatar copiltembel avatar haiyangwu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.