0

I installed everything according to the instructions and the project started: enter image description here

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?

1 Answers1

1

Same problem here. Try to put complete namespace for the controller.

Somthing like:

Websocket::on('test', '\App\Http\Controllers\Users\Telegram@connectServers');

It would be great if it worked with the shorted form.

Pacific
  • 11
  • 3