events/sse
事件流与生命周期

SSE 实时事件流

通过 Server-Sent Events 监听设备心跳、前台切换与系统通知

  • 连接端点:GET http://localhost:58166/gateway/sse
  • 请求头:Accept: text/event-stream,X-AppKey: <your-key>

核心事件载荷

{
  "type": "HEARTBEAT",
  "device_id": "848bd13e2f9",
  "battery": 92,
  "cpu": 15.2,
  "mem": 48.6,
  "storage": 55.1,
  "app": "com.tencent.mm",
  "status": "online"
}