1
0
Files
DiAL/docs/user/checkers/udp.md

1.8 KiB

UDP Checker

type: udp 用于 UDP payload 请求-响应检查。

配置项

字段 说明 必填 默认值
udp.host 目标主机地址
udp.port 目标端口,范围 1-65535
udp.payload 发送数据 ""
udp.encoding payload 编码:texthexbase64 text
udp.responseEncoding 响应解码:texthexbase64 text
udp.maxResponseBytes 响应最大字节数,支持 KBMBGB 单位 4KB

expect 校验项

字段 说明 必填 默认值
responded 期望是否收到响应 true
response 响应内容校验,使用 ContentExpectations 数组
responseSize 响应字节数校验,使用 ValueMatcher
sourceHost 响应来源地址校验,使用 ValueMatcher
sourcePort 响应来源端口校验,使用 ValueMatcher
durationMs 完整执行耗时校验,使用 ValueMatcher

示例

- id: "udp-heartbeat"
  name: "UDP 心跳检测"
  type: udp
  udp:
    host: "127.0.0.1"
    port: 9000
    payload: "PING"
  expect:
    responded: true
    response:
      - contains: "PONG"
    durationMs:
      lte: 100