hhxsv5 / laravel-s

LaravelS is an out-of-the-box adapter between Laravel/Lumen and Swoole.
MIT License
3.84k stars 475 forks source link

Can't push data in controller. #250

Closed Gildars closed 4 years ago

Gildars commented 4 years ago

Environment:

I can connect to ws server, but when I try to push data in controller getting an error.

$fd = 1; // Find fd by userId from a map [userId=>fd]. /*@var \Swoole\WebSocket\Server $swoole / $swoole = app('swoole'); $success = $swoole->push($fd, 'Push data to fd#1 in Controller');


**Error**
`Target class [swoole] does not exist.`
hhxsv5 commented 4 years ago

Hi, please make sure you request to Swoole Http Server, not FPM. Class swoole does not exist may be helpful.

Gildars commented 4 years ago

@hhxsv5 Thank you! I just opened port 5200 in the workspace container. изображение

Also sent all requests to http://mydomain.local: 5200/