swooletw / laravel-swoole

High performance HTTP server based on Swoole. Speed up your Laravel or Lumen applications.
MIT License
4.04k stars 389 forks source link

How to send websocket messages on the server #429

Open junshenshi opened 4 years ago

junshenshi commented 4 years ago

Make sure you read Issues Guideline and answer these questions before submitting your issue. Thanks! (Any non-English issues will be closed immediately.)

  1. Please provide your PHP and Swoole version. (php -v and php --ri swoole)

PHP 7.3.11 (cli) swoole

Swoole => enabled Author => Swoole Team team@swoole.com Version => 4.4.17 Built => Apr 20 2020 14:49:44 coroutine => enabled epoll => enabled eventfd => enabled signalfd => enabled cpu_affinity => enabled

  1. Please provide your Laravel/Lumen version.

laravel7

  1. Which release version of this package are you using? 2.6

  2. What did you do? If possible, provide a recipe for reproducing the error.

Command sends a websocket message

error:Target class [swoole.websocket] does not exist.

  1. What did you expect to see?

Successfully sent websocket message

  1. What did you see instead?

Error:Target class [swoole.websocket] does not exist.

albertcht commented 4 years ago

@happiness9721 ,

Do you call the websocket instance in the swoole server and turn on websocket mode?

happiness9721 commented 4 years ago

I have no idea😂 guess tag wrong pp? @junshenshi

solaz3 commented 3 years ago

confirmed Command cant invoke Websocket, using api for a workround 😂