美文网首页
ThinkPHP+workerman

ThinkPHP+workerman

作者: alfred88 | 来源:发表于2024-05-30 16:47 被阅读0次

如何在宝塔运行websocket?

前端不存在权限一说
只需要考虑token机制即可
每个用户有自己的token

客户端代码:


image.png
image.png

服务端代码:


image.png
image.png
image.png

即使关闭浏览器服务端也会触发onClose方法

参考资料:

https://blog.csdn.net/arlene12345/article/details/126320218

https://www.php.cn/faq/591309.html

https://blog.csdn.net/xiaomomo19/article/details/137273593

https://blog.csdn.net/weixin_41302755/article/details/124634346

https://gitee.com/yuhen/chat

https://www.kancloud.cn/manual/thinkphp6_0/1147857

https://www.workerman.net/doc/workerman/worker/on-worker-start.html

tp6 使用workerman 实现定时任务
https://blog.csdn.net/qq_58954197/article/details/130642467

相关文章

  • thinkphp+workerman=在线客服系统

    最近公司业务部门需求要上线在线客服系统,需要在线和客服实时沟通。第一时间想到用websocket实时通讯现将开发过...

网友评论

      本文标题:ThinkPHP+workerman

      本文链接:https://www.haomeiwen.com/subject/ocrrqjtx.html