wss://<服务器IP>/ws?sessionId=<sessionId>
所有消息均为 JSON 格式。
{ "type": "connected", "data": 10 // 当前 Session 的记录数量 }
{ "type": "entry-received", "data": { "id": "1234567890-abc123", "api": "/api/user/info", "response": "{\"code\": 0}", "timestamp": 1698764800000 } }
{ "type": "entry-updated", "data": { "id": "1234567890-abc123", "api": "/api/user/info", "timeConsuming": 120 } }
{ "type": "deleted", "data": "1234567890-abc123" // 删除的记录 ID }
{ "type": "cleared" }
客户端需定期发送心跳包保持连接:
{ "type": "ping" }
服务端响应:
{ "type": "pong" }
建议心跳间隔:30 秒。
connected
entry-received
entry-updated
deleted
cleared
ping
pong
当 WebSocket 断开时,建议: