{"name":"Server-Sent Events API with Durable Objects","description":"基于 Durable Objects 的实时数据推送服务","endpoints":{"connect":"/api/sse/connect - 建立SSE连接","stats":"/api/sse/stats - 连接统计信息","send":"/api/sse/send - 发送消息到指定连接","broadcast":"/api/sse/broadcast - 广播消息给所有连接","send-to-user":"/api/sse/send-to-user - 发送消息给指定用户","send-to-connection":"/api/sse/send-to-connection - 发送消息给指定连接","health":"/api/sse/health - 健康检查","info":"/api/sse/info - 服务信息"},"features":["基于 Durable Objects 的连接管理","指定连接/用户发送消息","广播消息给所有连接","连接统计和监控","自动连接清理","持久化连接状态"],"usage":{"connect":"const source = new EventSource(\"/api/sse/connect?userId=user123\")","events":["connect","message","broadcast","user-message","connection-message"],"examples":{"broadcast":"POST /api/sse/broadcast {\"data\": {\"message\": \"Hello all!\"}, \"event\": \"announcement\"}","sendToUser":"POST /api/sse/send-to-user {\"userId\": \"user123\", \"data\": {\"message\": \"Hello user!\"}}","sendToConnection":"POST /api/sse/send-to-connection {\"connectionId\": \"conn_123\", \"data\": {\"message\": \"Hello connection!\"}}"}}}