[Privoxy-users] Whitelisting based on client IPs

Fabian Keil fk at fabiankeil.de
Fri Feb 9 10:51:40 UTC 2018


Father Vlasie <fv at spots.school> wrote:

> I am new to Privoxy and I am trying to use it to replace a perl-based
> custom whitelisting system.
> 
> I have read a lot of the documentation but I could not quite figure out
> how to do what I need which is to whitelist websites based on the IP
> address of the client.
> 
> I have tried adding the following code to the default.action file but it
> just seems to block everything without making an exception for
> 10.10.20.3 to reach wikipedia.org or 10.10.20.5 to reach m-w.com.
> 
> 8<----8<----8<----8<----8<----8<----8<----
> 
> {+block{This domain is not in the whitelist.}}
> .
> +client-header-tagger{client-ip-address}

The line above doesn't seem to be part of an action section.
You may want to use:

{+client-header-tagger{client-ip-address}}
/

instead.

> {-block}
> .wikipedia.org/.
> TAG:^IP-ADDRESS: 10\.10\.20\.3$
> {-block}
> .m-w.com/.
> TAG:^IP-ADDRESS: 10\.10\.20\.5$
> 
> Any help is greatly appreciated!

Note that tag and URL patterns aren't combined with
an "and" condition. Sections are enabled if any
pattern matches.

You may want to use acls instead:
https://www.privoxy.org/user-manual/config.html#ACLS

Fabian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.privoxy.org/pipermail/privoxy-users/attachments/20180209/e750abcd/attachment.bin>


More information about the Privoxy-users mailing list