sing-box icon indicating copy to clipboard operation
sing-box copied to clipboard

Add optional tags field for route rules

Open Pushkinmazila2 opened this issue 6 months ago • 2 comments

This PR adds optional tag support for individual rules.

Currently tags are supported for rule-sets, but not for standalone rules. This change extends the same concept to regular rules to improve configuration structure and readability.

Example:

{
  "tag": "streaming",
  "domain_suffix": [
    "youtube.com",
    "netflix.com"
  ],
  "outbound": "proxy"
}

Motivation

Large configurations often contain many inline rules without an easy way to identify or group them.

Adding tags to rules helps:

  • improve config maintainability
  • simplify navigation in large configs
  • prepare groundwork for possible future conditional/tag-based processing

Compatibility

This change is fully backward compatible:

  • tag is optional
  • existing configurations continue to work unchanged

Pushkinmazila2 avatar May 22 '26 19:05 Pushkinmazila2

The tag field (with a small letter), and the Tag() is method.:

Pushkinmazila2 avatar May 22 '26 19:05 Pushkinmazila2

I suggest integrating tag before the architecture runs away again ) @nekohasekai

Pushkinmazila2 avatar May 23 '26 13:05 Pushkinmazila2