{"repo":"hezhizheng/go-gin-chat","free":true,"listed":false,"github":"https://github.com/hezhizheng/go-gin-chat","clone":"git clone https://github.com/hezhizheng/go-gin-chat.git","description":"Golang(Gin)+websocket 的多人聊天室 | go 聊天室 | golang 聊天室","language":"Go","stars":450,"topics":["gin","websocket","chat","gin-websocket","gin-chat","go","golang","chatroom"],"license":"MIT","category":"chat-messaging","readme_excerpt":"go-gin-chat(Gin+websocket 的多人聊天室) 练手小项目，为熟悉Gin框架跟websocket使用 💛💛💛💛💛💛 在线demo (PS: 请尽量使用Chrome游览器，开启多个不同用户游览器即可体验效果) github地址 🚀 广告 自用机场推荐,不贵、稳定、晚高峰不卡 TaiShan Net Feature - 登录/注册(防止重复登录) - 群聊(多房间、支持文字、emoji、文件(图片)上传，使用 freeimage.host 做图床 ) - 图片使用多个图床依次上传，防止被墙，sm.ms做兜底。 - 私聊(消息提醒) - 历史消息查看(点击加载更多) - 心跳检测及自动重连机制，来自 https://github.com/zimv/websocket-heartbeat-js - go mod 包管理 - 使用 Golang 1.16 embed 内嵌静态资源(html、js、css等)，运行只依赖编译好的可执行文件与mysql - 支持 http/ws 、 https/wss 结构 伪代码，详情可参考 serve.go - 定义客户端信息的结构体 - 定义全局变量 - 使用 make 创建一个全局的 map slice 用于存放房间与用户的信息，用户上线、离线实际上是对map的 append 跟 remove - 开启 goroutine 处理用户的连接、离线、消息发送等各个事件 界面 database mysql Tools - 模板提供 - github.com/gin-gonic/gin - gorm.io/driver/mysql - gorm.io/gorm - github.com/gravityblast/fresh - github.com/valyala/fasthttp - github.com/spf13/viper 使用 (go version = 1.16) nginx 部署 编译可执行文件(跨平台) TODO - [x] 心跳机制 - [x] 多频道聊天 - [x] 私聊 - [x] 在线用户列表 - [x] https支持 License MIT","default_branch":null,"files":null,"tree":[],"storefront":"/r/hezhizheng","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/hezhizheng/go-gin-chat/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}