Coder Social home page Coder Social logo

seif-abaza / video-call-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amirsanni/video-call-app

0.0 1.0 1.0 1.2 MB

A text, audio and video chat application built with webRTC and Ratchet (PHP WebSocket)

PHP 6.37% CSS 4.47% JavaScript 81.50% HTML 6.20% Shell 1.46%

video-call-app's Introduction

Video Call App

A one-to-one text, audio and video chat application built with webRTC and Ratchet (PHP WebSockets).

Requirements

  • PHP >= 5.4
  • Every other required files are included or referenced as the case may be

Getting Started

To test this app on your local server:

  • The Ratchet server must be ON. This can be achieved by navigating to video-call-app/ws/bin from your cli and run php server.php
  • Run the app from your browser at: http://localhost/video-call-app/
  • Create and enter a room
  • Enter the room from two different browsers (using the same link) and test by sending text chats. This can be done on the same device.
  • The audio and video call is best tested on two different devices. This will require more configuration
  • Open video-call-app/js/comm.js and change this line const wsChat = new WebSocket("ws://localhost:PORT/comm"); to const wsChat = new WebSocket("ws://YOUR_SERVER_IP:PORT/comm");
  • Open video-call-app/ws/bin/server.php and add your server ip address to $allowed_origins array, then replace the localhost and PORT in $app = new Ratchet\App('localhost', PORT, '0.0.0.0'); with your ip address and Port numberrespectively
  • Blam! Good to go. Navigate to YOUR_IP_ADDRESS/video-call-app on your browser on two different devices to start chatting
  • Works best on Chrome, Firefox and the latest versions of Opera desktop browser.

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 CentOS7.

  • 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 config file and add this: ProxyPass /wss/ ws://YOUR_SERVER_IP_OR_DOMAIN:PORT/

      e.g. ProxyPass /wss/ ws://www.abc.xyz:PORT/

    • From your front-end, you can connect like this:

      const wsChat = new WebSocket("wss://YOUR_SERVER_IP_OR_DOMAIN/wss/comm");

    However, if you are wondering how to edit apache config on WHM, here is how:

    • After enabling those services (mod_proxy.so and mod_proxy_wstunnel.so), log in to WHM,

    go to "service configuration" => "Apache configuration" => "include editor" => "pre main include",

    select a version of your choice or choose "All versions". The file name should be "pre_main_global.conf'

    • All your new configuration can be written in that textarea without tampering with httpd.conf directly. The configurations will be loaded on Apache start-up.
    • Once you put the Proxypass directive there, restart your server and there you go.

This answer on Stack Overflow should be helpful.

Demo

You can test at https://1410inc.xyz/video-call-app.

video-call-app's People

Contributors

amirsanni avatar gildonei avatar

Watchers

 avatar

Forkers

arfancitraw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.