Skip to content

[Feature]: Add block outbound option and domainStrategy selector for JSON Subscription routing rules #6072

Description

@SpeedeMiner

Is your feature request related to a problem?

Description

Currently, the JSON Subscription settings page (/panel/settings#subscription-formats) allows configuring routing rules only with the direct outbound (and the default proxy rule).

However, Xray already supports the block (blackhole) outbound, and the generated JSON subscription already contains a block outbound. The UI simply does not provide a way to use it.

It would also be useful to allow changing the routing.domainStrategy value from the UI instead of keeping it fixed to AsIs.

Proposed changes

  1. Add a Block option alongside the existing Direct option when creating routing rules in JSON Subscription.
  2. Add a Domain Strategy dropdown for the generated JSON configuration.

Suggested values:

  • AsIs
  • IPIfNonMatch
  • IPOnDemand

Example

Current generated routing:

"routing": {
  "domainStrategy": "AsIs",
  "rules": [
    {
      "domain": [
        "geosite:private"
      ],
      "outboundTag": "direct",
      "type": "field"
    }
  ]
}
"routing": {
  "domainStrategy": "IPIfNonMatch",
  "rules": [
    {
      "domain": [
        "geosite:category-ads-all"
      ],
      "outboundTag": "block",
      "type": "field"
    },
    {
      "domain": [
        "geosite:private"
      ],
      "outboundTag": "direct",
      "type": "field"
    }
  ]
}

### Describe the solution you'd like

Allows blocking ads, trackers, malware domains, or unwanted services directly in the generated subscription.
Exposes existing Xray functionality without requiring manual database edits.
Gives users control over domainStrategy, which can improve routing behavior depending on the deployment.
Backward compatible, as existing configurations would continue to use AsIs and direct by default.

Thank you for considering this feature.

### Alternatives you've considered

_No response_

### Concrete use case

_No response_

### Mockups, screenshots, or examples

_No response_

### Which parts of the panel would this affect?

_No response_

### Are you willing to help?

- [ ] I'd like to implement this feature myself and open a PR.
- [ ] I can help test once a PR is open.

### Before submitting

- [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested.
- [x] This feature request is written in English.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions