I installed everything according to the instructions and the project started:
I read wiki on Github,and on point 7 was this rout example:
Websocket::on('connect', function ($websocket, Request $request) {
// called while socket on connect
$websocket->emit('message', 'hello world');
});
Websocket::on('disconnect', function ($websocket) {
// called while socket on disconnect
});
Websocket::on('example', function ($websocket, $data) {
$websocket->emit('message', 'response from example action');
});
Websocket::on('message', function ($websocket, $data) {
$websocket->emit('message', 'response from message action');
// $websocket->push('message', 'response from message action by push');
});
Websocket::on('test', 'Users/Telegram@connectServers');
Websocket::on('joinToRoom', 'Users/Telegram@joinToRoom');
Now, when it’s connecting (I use this for tests) there is just a message hello word
and every message I used to send, have no answer.
Why?
How can I do right routes and controllers with swoole in laravel?