Install Node.js
curl -sL https://deb.nodesource.com/setup | sudo bash -sudo apt-get install -y nodejs
Create folder hold the EasyRTC application
sudo mkdir /var/nodesex: sudo mkdir /var/nodes/easyrtc
Security Considerations (not going into specifics)
ensure the node is run as that user.
Download files from the [serverexample folder](../serverexample/) into your EasyRTC application folder.
Change to the easyrtc folder and then install node modules locally
cd /var/nodes/easyrtcsudo npm installInstall Node.js
Run the Node.js installer
Create an EasyRTC application folder.
%HOMEDRIVE%%HOMEPATH%ex: C:\Users\USERNAME\nodes\easyrtc
Download files from the [serverexample folder](../serverexample/) into your EasyRTC application folder.
In the start menu, launch the Node.js command prompt
Navigate to the easyrtc folder. There should be a server.js and package.json file.
ex: cd C:\Users\USERNAME\nodes\easyrtc
Run the node package manager to download dependencies. This will create a new folder called node_modules
npm installInstall Node.js
Make sure /usr/local/bin is in your $PATH variable (echo $PATH)
Create an EasyRTC application folder.
ex: /Users/USERNAME/nodes/easyrtc
Download files from the [serverexample folder](../serverexample/) into your EasyRTC application folder.
Open a terminal window by double-clicking on Terminal within the Applications/Utilities directory in finder
Navigate to the easyrtc folder. There should be a server.js and package.json file.
ex: cd /Users/USERNAME/nodes/easyrtc
Run the node package manager to download dependencies. This will create a new folder called node_modules
npm installFor EasyRTC maintainers or those wishing to test the newer beta release, a Git client can be used to download EasyRTC directly from our Github repository. Afterwards, EasyRTC can be updated using standard Git commands.
Follow NodeJS install instructions for your OS
Clone EasyRTC repository folder.
git clone https://github.com/priologic/easyrtc.gitUsing Beta: git clone -b beta https://github.com/priologic/easyrtc.git
In the console, enter the easyrtc/ folder
cd easyrtc
Install EasyRTC dependencies from NPM
npm install
In the console, enter the server_example folder
cd server_example
Install EasyRTC Sample Server dependencies from NPM
npm installRunning the server from the console may be the best approach for development. It allows easy access to console messages which can alert you to problems and status.
Open your console on the server.
In Windows you can use the provided Node.js console program located in the Start Menu.
Navigate to your EasyRTC application folder
or using Git Install Steps directly cd server_example
Run the server using the node command.
node server.jsBelow is a small upstart script which can be saved as /etc/init/easyrtc.conf
description "EasyRTC Node.js server"
author "Priologic Software Inc."
# Saves log to /var/log/upstart/easyrtc.log
console log
# Starts only after drives are mounted.
start on started mountall
stop on shutdown
# Automatically Respawn. But fail permanently if it respawns 10 times in 5 seconds:
respawn
respawn limit 10 5
script
# Note: To run as a non root user, use exec sudo -u USERNAME node /var/nodes/easyrtc/server.js
# If nodejs is installed using Ubuntu's nodejs package, change /usr/bin/node to /usr/bin/nodejs
exec /usr/bin/node /var/nodes/easyrtc/server.js
end script
This will start EasyRTC at boot and allow you to start and stop the service in the console using the following:
sudo start easyrtc
sudo stop easyrtc
There are improvements which can be made such as increasing the open file limit, running the service as a non-root user, and adding notification commands to let administrators know of problems.
If you are using the packaged version of EasyRTC, upgrading is easy. In the console change to your application directory then enter:
npm upgrade
Note that you should first check the changelog to see if there are any breaking changes.
Below is the initial server program which will run an EasyRTC server along with all the demos. This server program is also included within the EasyRTC download.
// Load required modules
var http = require("http"); // http server core module
var express = require("express"); // web framework external module
var io = require("socket.io"); // web socket external module
var easyrtc = require("easyrtc"); // EasyRTC external module
// Setup and configure Express http server. Expect a subfolder called "static" to be the web root.
var httpApp = express();
httpApp.use(express.static(__dirname + "/static/"));
// Start Express http server on port 8080
var webServer = http.createServer(httpApp).listen(8080);
// Start Socket.io so it attaches itself to Express server
var socketServer = io.listen(webServer);
// Start EasyRTC server
var easyrtcServer = easyrtc.listen(httpApp, socketServer);
Configuration options are set using the setOption function or from the listen() function.
easyrtc.setOption('OPTION_NAME', 'OPTION_VALUE');
or
var easyrtcServer = easyrtc.listen(httpApp, socketServer, {'OPTION1_NAME': 'OPTION1_VALUE', 'OPTION2_NAME': 'OPTION2_VALUE'})
Note that some options can not be set after the listen() function has been run.
For complete details, read [serverconfiguration.md](serverconfiguration.md)
Browsing EasyRTC should be a snap. If you have installed the server on your desktop machine with the default settings, you can browse to it by going to:
If the server is located on another computer, you can browse to it by knowing the IP address or domain name:
Please feel free to post on our discussion forum:
Install Node.js
curl -sL https://deb.nodesource.com/setup | sudo bash -sudo apt-get install -y nodejs
Create folder hold the EasyRTC application
ex: sudo mkdir /var/nodes
Security Considerations (not going into specifics)
ensure the node is run as that user.
Download files from the git repository into your EasyRTC application folder.
sudo -icd /var/nodes/easyrtcgit clone https://github.com/priologic/easyrtc.git
Change to the easyrtc folder and then install node modules locally
cd /var/nodes/easyrtcsudo npm installcd /var/nodes/server_examplesudo npm installInstall Node.js
Run the Node.js installer
Create an EasyRTC application folder.
%HOMEDRIVE%%HOMEPATH%ex: C:\Users\USERNAME\nodes\easyrtc
Download from https://github.com/priologic/easyrtc/master.zip
In the start menu, launch the Node.js command prompt
Navigate to the easyrtc folder. There shold be several directories, including one called api
ex: cd C:\Users\USERNAME\nodes\easyrtc
Run the node package manager to download dependencies. This will create a new folder called nodemodules. You need to do this for the easyrtc directory and the serverexample directory.
npm installcd server_examplenpm installInstall Node.js
Make sure /usr/local/bin is in your $PATH variable (echo $PATH)
Open a terminal window by double-clicking on the Terminal within the Applications/utilities directory in finder. Create a directory in your account called nodes.
mkdir nodesex: cd ${HOME}/nodes
Download the easyrtc distribution into the nodes directory using git
ex: git clone https://github.com/priologic/easyrtc.git
or by pointing your browser at https://github.com/priologic/easyrtc/archive/master.zip, moving the zip file into the nodes directory, and unzipping it.
Navigate to the easyrtc folder.
ex: cd ${HOME}/nodes/easyrtc
Run the node package manager to download dependencies. This will create a new folder called node_modules
npm installcd server_examplenpm installRunning the server from the console may be the best approach for development. It allows easy access to console messages which can alert you to problems and status.
node server.jsBelow is a small upstart script which can be saved as /etc/init/easyrtc.conf
description "EasyRTC Node.js server"
author "Priologic Software Inc."
# Saves log to /var/log/upstart/easyrtc.log
console log
# Starts only after drives are mounted.
start on started mountall
stop on shutdown
# Automatically Respawn. But fail permanently if it respawns 10 times in 5 seconds:
respawn
respawn limit 10 5
script
# Note: To run as a non root user, use exec sudo -u USERNAME node /var/nodes/easyrtc/server.js
# If nodejs is installed using Ubuntu's nodejs package, change /usr/bin/node to /usr/bin/nodejs
exec /usr/bin/node /var/nodes/easyrtc/server_example/server.js
end script
This will start EasyRTC at boot and allow you to start and stop the service in the console using the following:
`sudo start easyrtc`
`sudo stop easyrtc`
There are improvements which can be made such as increasing the open file limit, running the service as a non-root user, and adding notification commands to let administrators know of problems.
If you are using the packaged version of EasyRTC, upgrading is easy. In the console change to your application directory then enter:
npm upgradeNote that you should first check the changelog to see if there are any breaking changes.
The beta branch has the most recent features and bug fixes. To switch to the beta branch, go to your easyrtc distribution directory and then:
git checkout betagit pullAnd then restart the server.
Below is the initial server program which will run an EasyRTC server along with all the demos. This server program is also included within the EasyRTC download. Note that this example program will only work for clients that are running on the same machine as the server; to modify the server.js to serve https so that clients running on other machines can use the server, see the easyrtcserverssl.md document (its easy but requires you set up certificates).
// Load required modules
var http = require("http"); // http server core module
var express = require("express"); // web framework external module
var io = require("socket.io"); // web socket external module
var easyrtc = require("easyrtc"); // EasyRTC external module
// Setup and configure Express http server. Expect a subfolder called "static" to be the web root.
var httpApp = express();
httpApp.use(express.static(__dirname + "/static/"));
// Start Express http server on port 8080
var webServer = http.createServer(httpApp).listen(8080);
// Start Socket.io so it attaches itself to Express server
var socketServer = io.listen(webServer);
// Start EasyRTC server
var easyrtcServer = easyrtc.listen(httpApp, socketServer);
Configuration options are set using the setOption function or from the listen() function.
easyrtc.setOption('OPTION_NAME', 'OPTION_VALUE');
or
var easyrtcServer = easyrtc.listen(httpApp, socketServer, {'OPTION1_NAME': 'OPTION1_VALUE', 'OPTION2_NAME': 'OPTION2_VALUE'})
Note that some options can not be set after the listen() function has been run.
For complete details, read [serverconfiguration.md](serverconfiguration.md)
Browsing EasyRTC should be a snap. If you have installed the server on your desktop machine with the default settings, you can browse to it by going to:
If the server is located on another computer, you can browse to it by knowing the IP address or domain name:
Note that browsers will refuse to access cameras and microphones if the client is on a different machine than the server, UNLESS your page is served https instead of http.
First check the easyrtcwebrtcproblems.md pages for a solution. After that, please feel free to post on our discussion forum: