gin-chat-demo

gin+websocket+mongodb实现 IM 即时聊天系统,基于WS连接的即时聊天,支持单聊,在线回复以及历史记录查询

MIT License

Stars
124
Committers
3

gin-chat-demo

gin+websocket+mongodb IM

WebSocket + MongoDB + MySQL + Redis

  • MySQL
  • MongoDB
  • Redis

Bhttps://www.bilibili.com/video/BV1BP4y1H7gV

https://blog.csdn.net/weixin_45304503/article/details/121787022

gin-chat-demo/
 cache
 conf
 e
 model
 router
 service
  • cache : redis
  • conf :
  • model :
  • pkg :
  • router
  • service

  • conf/config.ini
#debug,release
[service]
AppMode = debug
HttpPort = :3000 
#  3000

[mysql]
Db = mysql
DbHost = "" 
# mysqlip
DbPort = ""
# mysql,3306
DbUser = ""
# mysql user
DbPassWord = ""
# mysql password
DbName = ""
# 

[redis]
RedisDb = ""
# redis 
RedisAddr = ""
# redis 
RedisPw = ""
# redis 
RedisDbName = ""
# redis 

[MongoDB]
MongoDBName =  ""
MongoDBAddr = ""
MongoDBPwd = ""
MongoDBPort = ""

go mod tidy
go run main.go

  • http
  • ws
  • id=1id=2
  • id=2
Related Projects