Laravel-swoole: WebsocketHandler求助

Created on 17 Jul 2018  ·  2Comments  ·  Source: swooletw/laravel-swoole

Please answer these questions before submitting your issue. Thanks!

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

最新

  1. Please provide your Laravel/Lumen version.
    最新

  2. Which release version of this package are you using?
    最新

  3. What did you do? If possible, provide a recipe for reproducing the error.
    请问下这个类 SwooleTW\Http\Websocket\SocketIO\WebsocketHandler::class的onopen方法里的例子 对应的前端的例子是怎么样?
    那些Packet协议的参数大概有什么用 求助

  4. What did you expect to see?

  5. What did you see instead?

non-English question

Most helpful comment

Hi @junshenshi ,

The code in onOpen method of SwooleTW\Http\Websocket\SocketIO\WebsocketHandler::class is mainly to establish a socket.io connection. However, the socket.io protocol is not clearly documented in the official docs. But you can still refer to https://github.com/yasushi-saito/socket.io-spec and https://github.com/socketio/socket.io-protocol

All 2 comments

Hi @junshenshi ,

The code in onOpen method of SwooleTW\Http\Websocket\SocketIO\WebsocketHandler::class is mainly to establish a socket.io connection. However, the socket.io protocol is not clearly documented in the official docs. But you can still refer to https://github.com/yasushi-saito/socket.io-spec and https://github.com/socketio/socket.io-protocol

How to run a websocket in Laravel swoole??

this is my route file
27.0.0.1:1215/socket.io

this is the issue

ReflectionException in Route.php line 280: Class App\Http\Controllers\SwooleTW\Http\Controllers\SocketIOController does not exist

These are my details
PHP Version | 7.2.9-1+ubuntu16.04.1+deb.sury.org+1 |
| Swoole Version | 4.2.1 |
| Laravel Version | 5.2.45 |
| Listen IP | 127.0.0.1 |
| Listen Port | 1215 |
| Server Status | Online |
| Reactor Num | 2 |
| Worker Num | 2 |
| Task Worker Num | 0 |
| Websocket Mode | Off |
| PID | 14308 |
| Log Path | /var/www/html/laravel_5.2_swoole/storage/logs/swoole_http.log |

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MikeMaldini picture MikeMaldini  ·  10Comments

yl picture yl  ·  3Comments

junshenshi picture junshenshi  ·  3Comments

george-kar picture george-kar  ·  6Comments

codercms picture codercms  ·  5Comments