Skip to content

Allow to use CIDR notation in proxy rules #462

@Stefomat

Description

@Stefomat

Description

Hello,

being able to use different types of proxy rules is great. Domain, regex, wildcard, etc.
This makes life easy when creating rules for domain names and URLs.
But, I often want to connect to IP addresses that don't have a DNS record attached to them.
Even worse, I want to create rules for whole networks and subnets.

Creating individual Host Regex rules for those is tedious, as i have to convert them all to regex.
For example:
Creating a rule for subnet 192.168.1.0/25 results in regex ^(192\.168\.1\.(?:[0-9]|[1-9][0-9]|1(?:[0-1][0-9]|2[0-7])))$
A subnet 192.168.0.0/20 gets even worse (^(192\.168\.(?:[0-9]|1[0-5])\.(?:[0-9]|[1-9][0-9]|1(?:[0-9][0-9])|2(?:[0-4][0-9]|5[0-5])))$)

Would you consider it feasible to implement a "CIDR network" type rule?
In official Mozilla proxy auto configuration there is already a function that could serve as inspiration.
(isInNet(host, pattern, mask))

Thanks

Is your feature request related to a problem? Please describe.

No response

Describe alternatives you've considered

No response

Any additional context

Using wildcard matching alone is not feasible in this case.
Only certain network sizes (/8, /16, /24) can use wildcards (192.*, 192.168.*, 192.168.1.*)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions