feat(rules): extend slash-separated OR payload support to GEOSITE, GEOIP, and IP-ASN#2774
Open
aJC7737 wants to merge 1 commit into
Open
feat(rules): extend slash-separated OR payload support to GEOSITE, GEOIP, and IP-ASN#2774aJC7737 wants to merge 1 commit into
aJC7737 wants to merge 1 commit into
Conversation
61b8d7f to
17bed79
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend slash-separated payload support to more proxy rule types so a single rule can OR-match multiple values.
This adds support for:
GEOSITE,cn/gfw,...GEOIP,lan/cn,...IP-ASN,1/13335,...The behavior is consistent with existing slash-separated matching patterns already used in some rule payloads: values are split by
/and matched with OR semantics.What changed
Rule behavior
GEOSITEnow accepts multiple slash-separated categories and matches if any category matches.GEOIPnow accepts multiple slash-separated countries/pseudo-values and matches if any value matches.lan/cnare supported.lanbehavior is preserved.IP-ASNnow accepts multiple slash-separated ASNs and matches if any ASN matches.Parsing
Internal improvements
GEOSITEandGEOIP.GEOSITE/GEOIPmatchers on rule instances to avoid repeated matcher loading during match calls.GEOIP,lan,...record-size behavior explicit.Documentation
docs/config.yamlExamples
Tests
Added/updated tests covering: