Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 837 Bytes

File metadata and controls

41 lines (29 loc) · 837 Bytes

go-zero-websocket

基于go-zero框架,websocket 示例

  • 群发
  • 私聊
  • 连接加密
  • redis
  • mysql

使用

项目使用的是go module管理项目扩展,go版本1.20; 加解密部分请参考根目录:test.go

// 拉取项目依赖
go mod tidy

// 修改配置信息, redis 与 mysql 连接信息
// 这里暂未使用到mysql
websocket/etc/websocket-api.yaml
Redis:
  Host: 127.0.0.1:6379
  Type: node
  Pass:

// 运行
cd ./websocket &&  go run websocket.go

// 访问 web 页面
http://localhost:11111

效果预览