网络钩子
July 1, 2024Less than 1 minute
网络钩子
如何为 云眼 代理设置 Webhook 侦听器。
云眼代理实现了一个 Webhook 侦听器,用于接收来自 eyeofcloud.com 的入站 Webhook 请求。这些 webhook 启用 PUSH 样式通知,触发即时项目配置更新。
Webhook 侦听器配置在其自己的端口上(默认:8085),因为它可以配置为选择来自互联网的流量。
若要接受 Webhook 请求,必须通过将云眼灰度实验项目 ID 映射到一组 SDK 密钥以及用于验证入站请求的关联密钥来配置代理。下面可以看到一个示例 webhook 配置,而完整的示例配置可以在 GitHub 上提供的 config.yaml 中找到。
YAML
##
## webhook service receives update notifications to your 云眼灰度发布 project. Receipt of the webhook will
## trigger an immediate download of the datafile from the CDN
##
webhook:
## HTTP listener port
port: "8089"
## a map of 云眼灰度发布 Projects to one or more SDK keys
projects:
## <project-id>: 云眼灰度发布 project id as an integer
<project-id>:
## sdkKeys: a list of SDKs linked to this project
sdkKeys:
- <sdk-key-1>
- <sdk-key-1>
## secret: webhook secret used the validate the notification
secret: <secret-10000>
## skipSignatureCheck: override the signature check (not recommended for production)
skipSignatureCheck: true