Red5 Documentation

Configure WebRTC Authentication

Configure WebRTC Authentication

Watch a demonstration of the current section
  1. Inside of eclipse expand the folder example > src > main > webapp
  2. open publisher.html and add the connectionParams object inside of publisher.init(…)

         // Initialize
       publisher.init({
           protocol: 'ws',
           host: 'localhost',
           port: 8081,
           app: 'example',
           streamName: 'mystream',
           iceServers: iceServers,
           tcpMuxPolicy: 'negotiate',
           connectionParams: {username: "testuser", password: "testpass"}
         })
  3. open subscriber.html and add the connectionParams object inside of publisher.init(…)

          // Initialize
       subscriber.init({
           protocol: 'ws',
           host: 'localhost',
           port: 8081,
           app: 'example',
           streamName: 'mystream',
           iceServers: iceServers,
           subscriptionId: 'subscriber-' + Math.floor(Math.random() * 0x10000).toString(16),
           rtcpMuxPolicy: 'negotiate',
           connectionParams: {username: "testuser", password: "testpass"}
         })