Skip to content

Instantly share code, notes, and snippets.

@sbeleidy
Created May 8, 2016 07:49
Show Gist options
  • Save sbeleidy/5bd8c7aa88f60a1385f10b04e49e07af to your computer and use it in GitHub Desktop.
Save sbeleidy/5bd8c7aa88f60a1385f10b04e49e07af to your computer and use it in GitHub Desktop.
Easy RTC setup with reTURN
#####
# Signalling Server Setup ex: EasyRTC
# See https://easyrtc.com/docs/guides/easyrtc_server_install.php
# This assumes you followed https://gist.github.com/sbeleidy/f4cd7e96dc0910dbc27cc6845d8b4d22 and
# https://gist.github.com/sbeleidy/3a23999d8e9e5da9adc6159c3742b42b for SSL and reTURN setup
#####
# Install node
sudo apt-get install nodejs
sudo apt-get install npm
# Create folder for EasyRTC
sudo mkdir /var/nodes
sudo mkdir /var/nodes/easyrtc
cd /var/nodes/easyrtc
# wget http://easyrtc.com/files/easyrtc_server_example.zip # didn't work so:
wget https://raw.githubusercontent.com/priologic/easyrtc/master/server_example/server.js
wget https://raw.githubusercontent.com/priologic/easyrtc/master/server_example/package.json
mkdir static
cd static
wget https://raw.githubusercontent.com/priologic/easyrtc/master/server_example/static/index.html
npm install
nano server.js
# Update easyrtc = require("easyrtc");
# Add a variable var myOptions and replace it with the null in the listen command
# Example variable: (replace )
# var myOptions = {
# "appIceServers": [
# {url: "stun:YOUR.IP.ADDRESS:5349"},
# {
# "url":"turn:YOUR.IP.ADDRESS:5349",
# "username":"user",
# "credential":"pw"
# }
# ]
# };
#
#
# var rtc = easyrtc.listen(httpApp, socketServer, myOptions, function(err, rtcRef) {
#
# Update nginx to redirect properly to the easyrtc server
nano /etc/nginx/sites-available/default
# Add the following, replacing your IP address
# server {
# location / {
# proxy_pass http://localhost:8080;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection 'upgrade';
# proxy_set_header Host $host;
# proxy_cache_bypass $http_upgrade;
# }
# }
#
# Then run the following:
# sudo service nginx reload
#
nodejs server.js
# Go to your IP address or domain at port 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment