项目地址:
# leaf 官网 https://github.com/name5566/leaf # 基于 leaf 的 go module 版本 https://github.com/job520/leaf.git
leaf 使用介绍:
编辑 msg/msg.go 定义消息格式
编辑 gate/router.go 将消息格式路由到指定模块
编辑 {模块名}/internal/handler.go 注册处理函数
demo 用法:
下载项目:
git clone https://github.com/job520/leaf.git cd leaf
开启服务器:
go run main.go
使用 websocket 客户端:
用浏览器打开 index.html 文件
使用 tcp 客户端:
go run client.go
文档更新时间: 2021-01-28 18:56 作者:lee