Giter VIP home page Giter VIP logo

peerrtc-twilio-iceservers's Introduction

PeerRTC Twilio IceServers ☃️

A simple backend server used by PeerRTC for retrieving default ice servers provided by Twilio. Using this server is optional since there are a lot of ways to obtain ice servers.

💡 Additional Info

  • If no configurations parameter are provided in the PeerRTC constructor, then the module will automatically fetch ice servers from the server owned by us.

  • It is adviseable to provide own way of obtaining ice servers since we are only using free account in Twilio.

⚙️ Setup

  1. Create account and log in Twilio.
  2. Install Node.js first. Skip this step if already installed.
  3. Clone this repository.
  4. In command line, navigate to root directory of the newly downloaded repository.
  5. Install all needed dependencies via npm install in the command line.
  6. Set the enviroment variables. The server needed the TOKEN and SID environment as it will be passed in the Twilio api. In the command line,
set SID=your-account-sid
set TOKEN=your-token

Account sid and token can be found in Twilio console on Account Info section.

  1. Start the server by entering npm start in the command line.

👨‍🏫 Usage

The server is using the getIceServers get method to return an array of ice servers.

https://your-server.com/getIceServers

The returned array can be inserted in the PeerRTC constructor as follows:

fetch("https://your-server.com/getIceServers")
  .then(response=>response.json())
  .then(iceServers=>{
  
    serverURL = "https://my-own-server-url.com"
    configurations = {
      iceServers: iceServers,
      ...
    }
    
   peer = new PeerRTC(serverURL, configurations)
  })

peerrtc-twilio-iceservers's People

Contributors

shimshim27 avatar

Watchers

 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.