Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working on local #45

Open
ElsnerPHP opened this issue Jul 13, 2020 · 4 comments
Open

Not working on local #45

ElsnerPHP opened this issue Jul 13, 2020 · 4 comments

Comments

@ElsnerPHP
Copy link


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

@xuzhousoft09
Copy link

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

@ElsnerPHP
Copy link
Author

ElsnerPHP commented Jul 13, 2020 via email

@xuzhousoft09
Copy link

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.

@amirsanni
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants