Permalink
9dcf98c Jun 11, 2018
1 contributor

Users who have contributed to this file

executable file 140 lines (94 sloc) 3.75 KB

Installation Guide

This page explains how to install RTCMultiConnection.

Fetch from Github

Github is strongly recommended. NPM or TAR are secondary options.

git clone https://github.com/muaz-khan/RTCMultiConnection.git ./
npm install --production

Or download ZIP:

wget https://github.com/muaz-khan/RTCMultiConnection/archive/master.zip
unzip master.zip

Then call npm install --production.

Use --production to skip grunt dependencies. You don't need grunt until you modify library itself.

Install using NPM or Bower

npm install rtcmulticonnection --production

# or
bower install rtcmulticonnection

Run server.js

node server.js

Now open http://localhost:9001/.

Modify config.json

{
  "socketURL": "/",
  "socketMessageEvent": "abcdef",
  "socketCustomEvent": "ghijkl",
  "port": "443",
  "enableLogs": "false",
  "autoRebootServerOnFailure": "false",
  "isUseHTTPs": "true",
  "ssl_key": "/ssl/certificate.key",
  "ssl_cert": "/ssl/certificate.crt",
  "ssl_cabundle": "/ssl/certificate.cabundle"
}

Now run server.js and it will automatically use above configuration.

How to check if server is running correctly?

Open this URL: https://localhost:9001/socket.io/socket.io.js

If you can load /socket.io/socket.io.js on your server then it is working fine.

Stop Old Processes

Check all processes running on port 9001 and stop process by id:

lsof -n -i4TCP:9001 | grep LISTEN
kill process-ID

Or stop all processes on a specific port. (It may require sudo privileges):

fuser -vk 9001/tcp

Now open: http://localhost:9001/

Keep running server in background

nohup nodejs server.js > /dev/null 2>&1 &

Or:

nohup nodejs server.js &

Or use forever:

npm install forever -g
forever start server.js

To auto-start server.js on system-reboot (i.e. when Mac/Linux system shuts down or reboots):

npm install forever-service

cd __path to your npm install__
forever-service install ncustomAppName --script server.js

Commands to interact with service ncustomAppName Start:

- "sudo service ncustomAppName start" Stop
- "sudo service ncustomAppName stop" Status
- "sudo service ncustomAppName status" Restart - "sudo service ncustomAppName restart"

More info about forever-service here.

Other Documents

  1. Getting Started guide for RTCMultiConnection
  2. Installation Guide
  3. How to Use?
  4. API Reference
  5. Upgrade from v2 to v3
  6. How to write iOS/Android applications?
  7. Tips & Tricks

License

RTCMultiConnection is released under MIT licence . Copyright (c) Muaz Khan.