1 Star 0 Fork 0

websocket2024/gws

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
read_test.json 5.15 KB
一键复制 编辑 原始数据 按行查看 历史
lxzan 提交于 2023-06-12 09:54 +08:00 . merge close/error
[
{
"title": "empty string",
"fin": true,
"opcode": 1,
"length": 0,
"payload": "",
"expected": {
"event": "onMessage"
}
},
{
"title": "10 byte string",
"fin": true,
"opcode": 1,
"length": 10,
"payload": "",
"expected": {
"event": "onMessage"
}
},
{
"title": "10 byte binary",
"fin": true,
"opcode": 2,
"length": 10,
"payload": "",
"expected": {
"event": "onMessage"
}
},
{
"title": "125 byte string",
"fin": true,
"opcode": 1,
"length": 125,
"payload": "",
"expected": {
"event": "onMessage"
}
},
{
"title": "1000 byte string",
"fin": true,
"opcode": 1,
"length": 1000,
"payload": "",
"expected": {
"event": "onMessage"
}
},
{
"title": "131072 byte string",
"fin": true,
"opcode": 1,
"length": 131072,
"payload": "",
"expected": {
"event": "onMessage"
}
},
{
"title": "long data",
"fin": true,
"opcode": 1,
"length": 2000000,
"payload": "",
"expected": {
"event": "onClose"
}
},
{
"title": "invalid utf8 string",
"fin": true,
"opcode": 1,
"length": 0,
"payload": "cebae1bdb9cf83cebcceb5eda080656469746564",
"expected": {
"event": "onClose"
}
},
{
"title": "First OpcodeContinuation frame",
"fin": true,
"opcode": 0,
"length": 6,
"payload": "",
"expected": {
"event": "onClose"
}
},
{
"title": "First OpcodeContinuation frame",
"fin": false,
"opcode": 0,
"length": 6,
"payload": "",
"expected": {
"event": "onClose"
}
},
{
"title": "invalid opcode",
"fin": true,
"opcode": 3,
"length": 6,
"payload": "",
"expected": {
"event": "onClose"
}
},
{
"title": "valid ping",
"fin": true,
"opcode": 9,
"length": 0,
"payload": "",
"expected": {
"event": "onPing"
}
},
{
"title": "ping not fin",
"fin": false,
"opcode": 9,
"length": 0,
"payload": "",
"expected": {
"event": "onClose"
}
},
{
"title": "ping with payload",
"fin": true,
"opcode": 9,
"length": 10,
"payload": "",
"expected": {
"event": "onPing"
}
},
{
"title": "ping with long payload",
"fin": true,
"opcode": 9,
"length": 256,
"payload": "",
"expected": {
"event": "onClose"
}
},
{
"title": "pong",
"fin": true,
"opcode": 10,
"length": 0,
"payload": "",
"expected": {
"event": "onPong"
}
},
{
"title": "pong with payload",
"fin": true,
"opcode": 10,
"length": 16,
"payload": "",
"expected": {
"event": "onPong"
}
},
{
"title": "close",
"fin": true,
"opcode": 8,
"length": 0,
"payload": "03e8",
"expected": {
"event": "onClose",
"code": 1000
}
},
{
"title": "close",
"fin": true,
"opcode": 8,
"length": 0,
"payload": "03ea",
"expected": {
"event": "onClose",
"code": 1002
}
},
{
"title": "close",
"fin": true,
"opcode": 8,
"length": 0,
"payload": "0a",
"expected": {
"event": "onClose",
"code": 10,
"reason": ""
}
},
{
"title": "close with valid payload",
"fin": true,
"opcode": 8,
"length": 0,
"payload": "03e868656c6c6f",
"expected": {
"event": "onClose",
"code": 1000,
"reason": "68656c6c6f"
}
},
{
"title": "close with invalid code",
"fin": true,
"opcode": 8,
"length": 0,
"payload": "03f6",
"expected": {
"event": "onClose",
"code": 1014,
"reason": ""
}
},
{
"title": "close with code 0",
"fin": true,
"opcode": 8,
"length": 0,
"payload": "",
"expected": {
"event": "onClose",
"code": 0,
"reason": ""
}
},
{
"title": "close with invalid payload",
"fin": true,
"opcode": 8,
"length": 0,
"payload": "03efcebae1bdb9cf83cebcceb5eda080656469746564",
"expected": {
"event": "onClose",
"code": 1007,
"reason": "cebae1bdb9cf83cebcceb5eda080656469746564"
}
}
]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/websocket2024/gws.git
git@gitee.com:websocket2024/gws.git
websocket2024
gws
gws
dev

搜索帮助