Video-Call-App icon indicating copy to clipboard operation
Video-Call-App copied to clipboard

Not working on local

Open ElsnerPHP opened this issue 5 years ago • 4 comments


Notice: Undefined property: stdClass::$v in C:\xampp\htdocs\Video-Call-App-master\Server.php on line 15

Notice: Trying to get property 'iceServers' of non-object in C:\xampp\htdocs\Video-Call-App-master\Server.php on line 15
null****

image

ElsnerPHP avatar Jul 13 '20 05:07 ElsnerPHP

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

xuzhousoft09 avatar Jul 13 '20 06:07 xuzhousoft09

Hello, I have done that still I am getting error. it is not getting connected.

do you have any idea about this? -> https://stackoverflow.com/questions/62869583/php-web-socket-not-connect-in-ssl

Thank you

On Mon, Jul 13, 2020 at 12:06 PM xuzhousoft09 [email protected] wrote:

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

[image: image] https://user-images.githubusercontent.com/12077057/87277791-9e5b7380-c515-11ea-950a-b1d42a4bb683.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/amirsanni/Video-Call-App/issues/45#issuecomment-657387148, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALRRHG7P4YFRBYSBCQVFWZLR3KTPVANCNFSM4OYGDN5Q .

ElsnerPHP avatar Jul 13 '20 07:07 ElsnerPHP

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.

xuzhousoft09 avatar Jul 13 '20 09:07 xuzhousoft09

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

amirsanni avatar Jul 13 '20 13:07 amirsanni