mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 20:54:14 +00:00
Adds JSON fixtures under golden/fixtures/{dns,dns-server,balancer,rule}
plus three vitest files that parse them through the new schemas and
snapshot the result.
dns/: minimal (servers as strings) + full (every top-level field plus
hosts with geosite/domain/full prefixes and 5 mixed string/object
servers covering fakedns, localhost, https://, tcp://, quic+local://).
dns-server/: full (every DnsServerObject field) + legacy-expectips
(asserts the z.preprocess that migrates the legacy `expectIPs` key
into the canonical `expectedIPs`).
balancer/: random-minimal (default strategy by omission), roundrobin,
leastping, leastload-full (covers all StrategySettings fields and both
regexp=true|false costs).
rule/: minimal, full (exercises every RuleObject field including
localPort, localIP, process aliases like `self/`, all four protocol
enum values, ip negation `!geoip:`, attrs with regexp value, and the
WebhookObject with deduplication+headers), balancer-routed (uses
balancerTag instead of outboundTag), port-number (port as a number to
prove the union(number,string) accepts both).
18 lines
430 B
JSON
18 lines
430 B
JSON
{
|
|
"tag": "balancer-load",
|
|
"selector": ["proxy-"],
|
|
"fallbackTag": "fallback-out",
|
|
"strategy": {
|
|
"type": "leastLoad",
|
|
"settings": {
|
|
"expected": 3,
|
|
"maxRTT": "1s",
|
|
"tolerance": 0.05,
|
|
"baselines": ["500ms", "1s", "2s"],
|
|
"costs": [
|
|
{ "regexp": false, "match": "proxy-premium", "value": 0.1 },
|
|
{ "regexp": true, "match": "^proxy-cheap-.+$", "value": 5 }
|
|
]
|
|
}
|
|
}
|
|
}
|