salarcode / SmartProxy

Firefox/Chrome browser extension. SmartProxy will automatically enable/disable proxy for the sites you visit, based on customizable patterns.
https://addons.mozilla.org/en-US/firefox/addon/smartproxy/
GNU General Public License v3.0
1.86k stars 113 forks source link

How to set proxy rules to exclude IP segments? #379

Closed cloudkylin closed 4 months ago

cloudkylin commented 4 months ago

Description

I want to set proxy rules to exclude some LAN IPs to ensure that certain LAN services can be accessed normally when it is in "always enable" mode, such as 172.16.0.0/16, 192.168.0.0/24 or [:: 1]. But I tried using some general rules and it didn't work. I found this document: Proxy Rules, but it has too many "TBC..." and I can't get useful information from it. Can you provide me some examples to solve this problem? Thanks.

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

No response

Which browsers

Chrome, Firefox, Edge

Browser versions

No response

SmartProxy versions

No response

Screenshots

No response

Any additional context

No response

crypticviper commented 4 months ago

I too am struggling with the same. It doesn't seem to be possible with URL or Host based regex. It either says host is invalid or host doesn't match the regex. Any info on this would be very helpful.

salarcode commented 4 months ago

You can use Host Regex for IP addresses it can handle all sort of situations. Leave Rule Source Domain field empty For example to block IP ranges like 10.0.0.* use this regex: 10\.0\.0\..+ For 172.16.0.0 use 172\.16\..+\..+

You can test your RegEx here: https://regex101.com/