VXVX Docs

Router

RouterConfig and RuleConfig

Routing is configured in ServerConfig.router (RouterConfig). Schema: protos/proto/vx/router/router.proto.

Rules are evaluated in order. The first matching rule decides the outbound or selector.

RouterConfig

FieldTypeDescription
rulesRuleConfig[]Ordered routing rules

RuleConfig

Destination: set exactly one of outboundTag or selectorTag. If both are empty, the connection is blocked.

FieldDescription
outboundTagSend to this outbound handler
selectorTagSend to a selector (client / load-balancing)
matchAllMatch every connection
inboundTagsMatch inbound tag
usernamesMatch authenticated user id
srcCidrs, srcIpTagsSource IP match
dstCidrs, dstIpTagsDestination IP match
geoDomains, domainTagsDomain match (uses geo sets)
networksTCP, UDP, etc.
srcPortRanges, dstPortRangesPort ranges
appIds, appTagsApplication id match (client)
protocolsProtocol sniff result
ipv6IPv6-only match
fakeIpMatch fake-IP destinations
resolveDomainResolve domain to IP; all IPs must be in dstIpTags
resolveSoftRewriteResolve and rewrite target to an IP in dstIpTags
resolveSoftNoRewriteResolve without rewriting target
skipSniffDisable sniff for IP-target connections
conditionNested Condition with the same matchers (composable)
fallbacksTry alternate selector/outbound if primary fails
ruleNameDebug label

Fallback

FieldDescription
selectorTag, outboundTagAlternate destination
action.ipToDomainRewrite IP back to domain when falling back
dstIpTags, domainTags, matchAll, conditionExtra match for this fallback
lastIf condition matches, stop after this fallback

Condition

Same matchers as RuleConfig but without outboundTag / selectorTag / fallbacks. Used inside rule.condition or fallback.condition. Includes hasDomain to match only when a domain is present.

SelectorConfig

Selectors group outbounds by tag filters and picking strategy (mainly used on the client).

FieldDescription
tagReferenced by selectorTag on rules
filterprefixes, tags, subStrings, inverse, groupTags, countryCodes, …
strategyALL, ALL_OK, LEAST_PING, MOST_THROUGHPUT, TOP_PING, TOP_THROUGHPUT
balanceStrategyRANDOM or MEMORY
landHandlersLanding handler ids
selectFromOmSelect from outbound manager (non-DB mode)
speedTestSize, speedTestInterval, pingTestInterval, …Health and speed tests

Examples

Route everything to direct:

{
  "router": {
    "rules": [
      { "matchAll": true, "outboundTag": "direct" }
    ]
  }
}

Route one inbound to an outbound:

{
  "router": {
    "rules": [
      {
        "inboundTags": ["trojan"],
        "matchAll": true,
        "outboundTag": "direct"
      }
    ]
  }
}
  • GeodomainTags, dstIpTags, geoDomains
  • DNS — resolution for resolveDomain rules
  • Dispatcher — sniffing affects protocol/domain matching

Comments