-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QUESTION] websocket onclose 如何获取到关闭连接的code和reason #6724
Comments
你的这个文件是当server是协程时才会启动,而我的项目是'mode' => SWOOLE_PROCESS, 配置文件如下
] 我在server里和顶级的settings加了这个配置,并且在启动sever时打印配置已经生效了 并通过swooleServer->set进行了配置 但是onMessage里还是拿不到关闭帧,也就拿不到code了 |
额,不如你本地先试试?万一呢? |
试过了,确实并不走这个逻辑。。 |
按照websocket协议,关闭连接时会(可以)有一个code和reason,而hyperf服务器的onclose中如果获取到这个值呢
如果无法获取,我在swoole的配置中看到了这个,似乎可以变相的获取到,但是当我在server.php的settings中增加了这个配置,似乎并不生效,close并没有回调到onmessage里,是hyperf不支持这个配置嘛
https://wiki.swoole.com/zh-cn/#/server/setting?id=open_websocket_close_frame
The text was updated successfully, but these errors were encountered: