跳转至

拨号字段

结构

{
  "detour": "upstream-out",
  "bind_interface": "en0",
  "inet4_bind_address": "0.0.0.0",
  "inet6_bind_address": "::",
  "routing_mark": 1234,
  "reuse_addr": false,
  "connect_timeout": "5s",
  "tcp_fast_open": false,
  "tcp_multi_path": false,
  "udp_fragment": false,
  "domain_strategy": "prefer_ipv6",
  "fallback_delay": "300ms"
}

字段

字段 可用上下文
bind_interface /*bind_address /routing_mark /reuse_addr / tcp_fast_open / tcp_mutli_path / udp_fragment /connect_timeout detour 未设置

detour

上游出站的标签。

启用时,其他拨号字段将被忽略。

bind_interface

要绑定到的网络接口。

inet4_bind_address

要绑定的 IPv4 地址。

inet6_bind_address

要绑定的 IPv6 地址。

routing_mark

仅支持 Linux。

设置 netfilter 路由标记。

reuse_addr

重用监听地址。

tcp_fast_open

启用 TCP Fast Open。

tcp_multi_path

需要 Go 1.21。

启用 TCP Multi Path。

udp_fragment

启用 UDP 分段。

connect_timeout

连接超时,采用 golang 的 Duration 格式。

持续时间字符串是一个可能有符号的序列十进制数,每个都有可选的分数和单位后缀, 例如 "300ms"、"-1.5h" 或 "2h45m"。 有效时间单位为 "ns"、"us"(或 "µs")、"ms"、"s"、"m"、"h"。

domain_strategy

可选值:prefer_ipv4 prefer_ipv6 ipv4_only ipv6_only

如果设置,域名将在请求发出之前解析为 IP。

默认使用 dns.strategy

fallback_delay

在生成 RFC 6555 快速回退连接之前等待的时间长度。 也就是说,是在假设之前等待 IPv6 成功的时间量如果设置了 "prefer_ipv4",则 IPv6 配置错误并回退到 IPv4。 如果为零,则使用 300 毫秒的默认延迟。

仅当 domain_strategyprefer_ipv4prefer_ipv6 时生效。