|
|
4 years ago | |
|---|---|---|
| css | 6 years ago | |
| img | 7 years ago | |
| js | 6 years ago | |
| media | 9 years ago | |
| ws/bin | 6 years ago | |
| .gitattributes | 9 years ago | |
| .gitignore | 6 years ago | |
| README.md | 6 years ago | |
| SECURITY.md | 4 years ago | |
| Server.example.php | 6 years ago | |
| comm.html | 6 years ago | |
| composer.json | 6 years ago | |
| composer.lock | 6 years ago | |
| create-ratchet-as-a-service-with-daemon.txt | 8 years ago | |
| index.html | 9 years ago | |
| install-start-stop-daemon.txt | 6 years ago | |
| ratchet_as_a_service.txt | 9 years ago | |
README.md
Video Call App
A one-to-one text, audio and video chat application built with WebRTC and RatchetPHP.
Requirements
- PHP >= 5.4
- Composer
Features
- Video call
- Audio call
- Recording
- Text chat
- Two participants only
If you require more than two participants, check out this and this.
Getting Started
To test this app on your local server:
- Run
composer installfrom the root directory to install dependencies. - Set your app root (base url) in
/js/config.js. - Open
/ws/bin/server.phpand add yourdomain nameand/orip addressto$allowed_originsarray, then replace thelocalhostandPORTin$app = new Ratchet\App('localhost', PORT, '0.0.0.0');with either yourdomain nameorip addressandPort numberrespectively. - Set your web socket url in
/js/config.js. Ensure thedomain nameandportmatches what you set above. Usewssfor secured connection. - Start Ratchet server by executing
php ws/bin/server.phpfrom your CLI. - Blam! Good to go. Open the app on two different devices to start chatting.
- Works best on Chrome, Firefox and the latest versions of Opera desktop browser.
- Xirsys' free STUN/TURN servers were used. If interested, you can get a free xirsys account, rename
Server.example.phptoServer.phpand update it with your free credentials. Alternatively, you can use any STUN/TURN of your choice.
Note
To host this online, you'll need to set up a few things:
-
Create Ratchet as a service so it can run persistently on your server. Check the file create-ratchet-as-a-service-with-daemon.txt for the guide on how to do this on linux servers.
-
If on SSL, Ratchet won't work unless you make some changes on your server.
-
Enable mod_proxy.so
-
Enable mod_proxy_wstunnel.so
-
Open your apache SSL config file and add this:
ProxyPass /wss-secured/ ws://WEB_SOCKET_DOMAIN:WEB_SOCKET_PORT/e.g.
ProxyPass /wss-secured/ ws://www.abc.xyz:PORT/Note that you can substitute the
wss-securedabove with any path of your choice but you have to use the same path while connecting from the front-end as shown below. -
Update your web socket url in
/js/config.js:const wsUrl = 'wss://YOUR_WEB_SOCKET_DOMAIN/wss-secured';
-
-
Please note that most browsers will not allow access to media devices except the application is running on SSL or localhost (127.0.0.1).
Demo
You can test at https://1410inc.xyz/video-call-app.