Skip to content

loadbalance ​

把流分摊到多个成员。

yaml
outbounds:
  direct:
    type: direct
  proxy:
    type: socks
    server: proxy.example:1080
  spread:
    type: loadbalance
    outbounds: [proxy, direct]
    strategy: consistent_hashing

route:
  final: spread

dns:
  servers:
    default: {type: udp, address: 127.0.0.1:53}
  final: default

字段 ​

type ​

  • 类型:字符串。
  • 必填:是,第一项。
  • 取值:loadbalance。

strategy ​

  • 类型:字符串枚举。
  • 默认:consistent_hashing。
  • 取值:consistent_hashing、round_robin、sticky_sessions。

说明 ​

consistent_hashing 按目的站点的稳定哈希选成员;round_robin 轮流;sticky_sessions 尽量把同一客户端的同一站点留在同一成员。成员和探测字段见公共分组字段;默认每 5m 探测一次。

相关 ​

页面历史

开发者设计、代码地图和验证记录保留在仓库 manual/。