Files
opsxapi/homepage/content/09-sse.md
T
Logan.Li 3cb9545121 refactor(homepage): 官网/文档/定价源码迁出程序 + 新增独立授权与激活页 /license
- 官网源码归拢到 homepage/(index/pricing/terms/license + content/ + assets/ + docs-assets/),
  删除程序内 go:embed 的 server/internal/{site,docs},后端仅静态托管 homepage/dist 做本地预览
- 新增独立静态页 /license(授权与激活):交付与激活四步(邮件交付授权码)、
  在线授权码 LIC- 与离线许可证 LICOFF- 对比、授权服务器 licence.rlwj.cn 通信范围说明、
  授权类型与价格、10 条授权 FAQ
- tools/homepage-build 支持可选单页,产出 <name>.html 与 <name>/index.html
- 导航/页脚接入 /license,跨页锚点补 / 前缀,页脚底栏文案同步为静态站口径
2026-10-16 04:16:16 +08:00

30 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 连接事件流
1. 填写 SSE 地址(如 `https://stream.wikimedia.org/v2/stream/recentchange`)。
2. 点击 **连接**,事件按到达顺序流入消息日志。
3. 每条消息按 `event:` 名称归类显示;`data` 为 JSON 时自动格式化。
## 直连与代理自动切换
- 默认**直连**目标站(fetch 流式读取,延迟最低)。
- 直连因 CORS / 网络失败时,自动降级走**本地 Gin 流式代理**,日志中会提示切换过程,无需手工干预。
## 断点续传(Last-Event-ID)
「连接配置」中填写 Last-Event-ID,连接时以 `Last-Event-ID` 请求头携带,支持断点续传的流会在该事件之后继续推送。
## 连接配置项
| 配置 | 说明 |
| --- | --- |
| Query 参数 / Headers | 以键值对附加 |
| Last-Event-ID | 断点续传游标 |
| 仅显示 data 内容 | 开启后只显示 `data:` 载荷;关闭则连同 `event:` 名称一起显示 |
| 鉴权 | 与 HTTP 相同(Bearer / Basic / API Key) |
## 典型场景
- LLM 流式输出接口(`text/event-stream`)
- 监控 / 审计事件流
- 需要长期挂机观察的推送通道