Updated example to match decoupling
This commit is contained in:
parent
69afb3de1f
commit
7b5b215c44
@ -39,6 +39,7 @@ Need help? Have a question? Want to provide feedback? Write a message on the
|
|||||||
use Ratchet\MessageComponentInterface;
|
use Ratchet\MessageComponentInterface;
|
||||||
use Ratchet\ConnectionInterface;
|
use Ratchet\ConnectionInterface;
|
||||||
use Ratchet\Server\IoServer;
|
use Ratchet\Server\IoServer;
|
||||||
|
use Ratchet\Http\HttpServer;
|
||||||
use Ratchet\WebSocket\WsServer;
|
use Ratchet\WebSocket\WsServer;
|
||||||
|
|
||||||
require __DIR__ . '/vendor/autoload.php';
|
require __DIR__ . '/vendor/autoload.php';
|
||||||
@ -76,7 +77,7 @@ class Chat implements MessageComponentInterface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the server application through the WebSocket protocol on port 8080
|
// Run the server application through the WebSocket protocol on port 8080
|
||||||
$server = IoServer::factory(new WsServer(new Chat), 8080);
|
$server = IoServer::factory(new HttpServer(new WsServer(new Chat)), 8080);
|
||||||
$server->run();
|
$server->run();
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user