Running WebSocket direct in php class

2

I am now starting with websocket, I have developed a realtime chat using the Ratchet library, I would like if there is any way to initialize the websocket without having to run command through the terminal.

I saw in the documentation the command:

<?php 

$app = new Ratchet\App('localhost', 8080);
$app->route('/chat', new MyChat);
$app->route('/echo', new Ratchet\Server\EchoServer, array('*'));
$app->run();
    
asked by anonymous 10.07.2016 / 23:06

1 answer

1

For the development environment, the command is the simplest way to run. It takes some form to have the process running in parallel to listen to the sent requests.

An alternative would be to create an environment as if it were a production environment using supervisord , as pointed out in the Ratchet documentation .

    
10.07.2016 / 23:21