Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 55b92df

Browse files
authored
Update README.md
1 parent 71d89d8 commit 55b92df

File tree

1 file changed

+65
-1
lines changed

1 file changed

+65
-1
lines changed

README.md

+65-1
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,80 @@
5050
| JSON | 1 | |
5151
| YAML | 2 | |
5252
| XML | 3 | |
53-
| CSV | 4 | |
53+
| CSV | 4 | 适用于列表形式的数据 |
5454
| Protobuf | 5 | |
5555
| MessagePack | 6 | |
5656
| Reserved | 7 | 保留 |
5757

5858

5959
## 交互说明
6060

61+
62+
63+
### CONNECT 连接
64+
65+
首次连接
66+
67+
```javascript
68+
{
69+
client_id: "123123123123", //客户端ID,可选
70+
username: "user", //用户名
71+
password: "123456", //密码
72+
}
73+
```
74+
75+
再次连接
76+
```javascript
77+
{
78+
client_id: "123123123123", //客户端ID
79+
token: "xyzxyzxyzxyz", //登录证书
80+
}
81+
```
82+
83+
### CONNACK 连接响应
84+
85+
```javascript
86+
{
87+
client_id: "123123123123", //客户端ID
88+
return: "ok/fail", //结果
89+
reason: "密码错误", //错误原因
90+
token: "abcabcabcabc", //登录证书
91+
}
92+
```
93+
94+
### HEARTBEAT 心跳
95+
无内容
96+
97+
### STREAM 数据流
98+
6199
流ID,客户端发起用奇数,服务端发起用偶数
62100

101+
内容为二进制
102+
103+
### REQUEST 请求
104+
105+
```javascript
106+
{
107+
module: "fs", //模块
108+
command: "create", //命令
109+
data: {}, //数据
110+
}
111+
```
112+
113+
### RESPONSE 响应
114+
```javascript
115+
{
116+
//自定义数据响应
117+
}
118+
```
119+
120+
### DISCONNECT 关闭连接
121+
```javascript
122+
{
123+
reason: "restart", //关闭原因
124+
}
125+
```
126+
63127

64128
## 协议支持
65129

0 commit comments

Comments
 (0)