Building a Text, Audio and Video Chat Web App Using WebRTC and Ratchet
Amir Sanni
1136

i am trying to run the app on two different computer connected via home router with one as a server running server.php but i am facing a problem . I dont know where to put the server ip address 192.168.0.110 and where to put the clients ip address 192.168.0.116 in server.php file .I have already put my server ip address const wsChat = new WebSocket(“ws://192.168.0.110:8080/comm".

whats wrong in the code below ?

require ‘../vendor/autoload.php’;

use Amir\Comm;

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

// Run the server application through the WebSocket protocol on port 8080
$app = new Ratchet\App(‘192.168.0.110’, 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();

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.