GithubHelp home page GithubHelp logo

Not working on local about video-call-app HOT 4 OPEN

amirsanni avatar amirsanni commented on May 27, 2024
Not working on local

from video-call-app.

Comments (4)

xuzhousoft09 avatar xuzhousoft09 commented on May 27, 2024 1

Hi, you should configure your apache proxy correctly.
In my case:

/etc/apache2/sites-available/default-ssl.conf

ServerAdmin webmaster@localhost
DocumentRoot /var/www/html

ServerName 192.168.0.109

RewriteCond ${HTTP:Upgrade} websocket [NC]
RewriteCond ${HTTP:Connection} upgrade [NC]

RewriteRule /(.*)  ws://192.168.0.109:8080$1 [P,L]
ProxyPass /secure/ ws://192.168.0.109:8080/
ProxyPassReverse /secure/ ws://192.168.0.109:8080/

ProxyRequests off

......

config.js

'use strict';

const appRoot = 'https://192.168.0.109/video-call-app/';
const wsUrl = 'wss://192.168.0.109/secure';
const spinnerClass = 'fa fa-spinner faa-spin animated';

comm.js

const room = getRoom();

window.addEventListener('load', function(){
console.log(${wsUrl});
wsChat = new WebSocket(${wsUrl}/comm);

server.php

require 'vendor/autoload.php';

use Amir\Comm;
use Ratchet\App;

//set an array of origins allowed to connect to this server
$allowed_origins = ['192.168.0.109', '127.0.0.1'];

// Run the server application through the WebSocket protocol on port 8080
$app = new App('192.168.0.109', 8080, '0.0.0.0');//App(hostname, port, 'whoCanConnectIP', '')

//create socket routes
//route(uri, classInstance, arrOfAllowedOrigins)
$app->route('/comm', new Comm, $allowed_origins);

//run websocket
$app->run();

restart your apache and your video-call-app

I hope it can help you.

from video-call-app.

xuzhousoft09 avatar xuzhousoft09 commented on May 27, 2024

Hi, based on your Notice, I doubt your Server.php is not configured correctly.
You need a turn/stun server, and the Server.php file should be configured like this:

image

from video-call-app.

ElsnerPHP avatar ElsnerPHP commented on May 27, 2024

from video-call-app.

amirsanni avatar amirsanni commented on May 27, 2024

@ElsnerPHP If you're testing on local, you should be able to connect to the web socket server successfully without using SSL (i.e. ws). However, the remote user won't be able to access their media devices (Camera and Microphone) unless you have SSL setup.

from video-call-app.

Related Issues (20)

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.