GstWebRTC - AppRTC Signaling Examples - x86

From RidgeRun Developer Wiki




Previous: PubNub Signaler Examples - x86 Index Next: MediaSoup Signaling Examples - x86




This page presents the GstRrWebRTC examples using the AppRTC signaling on x86 platform.

Setup AppRTC Node Server with our websocket server

To run GstRrWebRTC examples using the AppRTC signaling, its necessary to run AppRTC locally using a websocket server in your host machine. Please follow the next setup:

Setup Websocket server

A websocket-based signaling server in go on your host machine.

Building

  • Install nodejs and npm:
sudo apt-get install nodejs npm
  • Make sure to set the $GOPATH according to the Go instructions in step 1
export GOPATH=$HOME/goWorkspace/ 
mkdir -p $GOPATH/src
  • Checkout the apprtc repository and clone it into $GOPATH/src
git clone https://github.com/webrtc/apprtc.git
  • Link the collider directories into $GOPATH/src
 ln -s apprtc/src/collider/collider $GOPATH/src
 ln -s apprtc/src/collider/collidermain $GOPATH/src
 ln -s apprtc/src/collider/collidertest $GOPATH/src
  • Install dependencies
go get collidermain
  • Install collidermain
go install collidermain

Setup AppRTC Node Server

Setting up just requires the following:

git clone https://github.com/RidgeRun/apprtc-node-server.git ./apprtc-node-server
cd ./apprtc-node-server
npm install

Modify the Port

Open the bin/www file

Change as below:

-var port = normalizePort(process.env.PORT || '3000');
+var port = normalizePort(process.env.PORT || '8080');
 app.set('port', port);

Modify the Websocket URL

Add the WebSocket Server URL (IP_ADDRESS) where the server is running.

  • Open the routes/index.js file
  • Change as below:
   TURN_URL_TEMPLATE: '%s/turn?username=%s&key=%s',
   CEOD_KEY: '4080218913',
   WSS_HOST_ACTIVE_HOST_KEY: 'wss_host_active_host', //memcache key for the active collider host.
-  WSS_HOST_PORT_PAIRS: ['apprtc-ws.webrtc.org:443', 'apprtc-ws-2.webrtc.org:443'],
+  WSS_HOST_PORT_PAIRS: ['<websocket_url>:8089', 'apprtc-ws-2.webrtc.org:443'],
   RESPONSE_ERROR: 'ERROR',
   RESPONSE_UNKNOWN_ROOM: 'UNKNOWN_ROOM',
   RESPONSE_UNKNOWN_CLIENT: 'UNKNOWN_CLIENT',
@@ -152,8 +152,8 @@ function getWSSParameters(req) {
     }
   } else {
     return {
-      wssUrl: 'wss://' + wssHostPortPair + '/ws',
-      wssPostUrl: 'https://' + wssHostPortPair,
+      wssUrl: 'ws://' + wssHostPortPair + '/ws',
+      wssPostUrl: 'http://' + wssHostPortPair,
       host: wssHostPortPair
     }
   }

Examples Index

After following above steps you'll be able to run GstRrWebRTC examples rising AppRTC Node Server and Websocket server locally.

 1. Audio Examples
 2. Video Examples
 3. Audio + Video Examples
 4. Demo Web Page



Previous: PubNub Signaler Examples - x86 Index Next: MediaSoup Signaling Examples - x86