17 Star 61 Fork 19

sh7ning / laravel-chat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Gopusher Chat

这是一个聊天应用,演示地址: https://chat.yadou.net, 支持单聊和群聊,目前demo中默认只加入群组1,具体的实现逻辑可以看源码实现。

所有的业务逻辑(逻辑层和路由层)采用Laravel实现,长连接采用Gopusher Comet(接入层)实现。除了Laravel外,还引入以下依赖:

安装

  1. 首先需要安装 Gopusher Comet 并进行配置

  2. 下载 Chat,并安装

    git clone https://github.com/Gopusher/laravel-chat.git
    配置 .env
    composer install

其它

  • 其实以前采用了自己的一个框架实现了一个版本(已废弃),但是觉得还是 Laravel 使用的人更多,也更容易方便大家参考,所以就采用了Laravel实现了一版,他们都依赖了Gopusher Comet来维护与客户端建立的长连接,
  • Gopusher Comet 是一个 开源支持分布式部署通用 长连接接入层服务,接管客户端连接,支持集群,提供了API供开发者调用。
  • 除了能用于聊天应用,还能用于如网页消息推送,游戏等其他长连接场景下的应用,开发文档见 https://github.com/Gopusher/comet/wiki
  • 因为很多时候业务逻辑都很具体,每个产品的需求都会不同,所以这个源码没有实现很漂亮的客户端,只是为了展示怎么实现Comet来实现一个分布式聊天,里边有分布式的comet路由保持相关的逻辑,不过路由层和业务逻辑层没有分太细。
MIT License Copyright (c) 2018 Gopusher Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Laravel + Gopusher Comet接入层 实现的聊天应用 展开 收起
PHP 等 3 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
PHP
1
https://gitee.com/sh7ning/laravel-chat.git
git@gitee.com:sh7ning/laravel-chat.git
sh7ning
laravel-chat
laravel-chat
master

搜索帮助