This page explains how to install RTCMultiConnection.
- Youtube Video: NPM install or Other Videos
Github is strongly recommended. NPM or TAR are secondary options.
git clone https://github.com/muaz-khan/RTCMultiConnection.git ./
npm install
Or download ZIP:
wget https://github.com/muaz-khan/RTCMultiConnection/archive/master.zip
unzip master.zip
Then call npm install
.
npm install rtcmulticonnection
# or
bower install rtcmulticonnection
# install all required packages first
npm install
# then run the server
node server.js
Now open http://localhost:9001/
.
{
"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.
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.
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/
``sh
npm install pm2 -g
pm2 startup
pm2 start server.js
pm2 save
Now `server.js` will auto restart on failure. Even auto run as soon as operating system reboots.
For more info about `pm2` please check [this link](https://github.com/Unitech/pm2).
## Keep running server in background usnig `nohup`
```sh
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.
If you are installing on heroku, please make sure to enable following config variables:
NODE_MODULES_CACHE:false
NPM_CONFIG_PRODUCTION:false
YARN_PRODUCTION:false
You can set above variables through heroku CLI as well:
heroku config:set NPM_CONFIG_PRODUCTION=false YARN_PRODUCTION=false NODE_MODULES_CACHE=false
- Getting Started guide for RTCMultiConnection
- Installation Guide
- How to Use?
- API Reference
- Upgrade from v2 to v3
- How to write iOS/Android applications?
- Tips & Tricks
RTCMultiConnection is released under MIT licence . Copyright (c) Muaz Khan.