[Privoxy-users] External filter never executes

Fabian Keil fk at fabiankeil.de
Sun Aug 17 18:43:43 CEST 2025


Tibor Pataky via Privoxy-users <privoxy-users at lists.privoxy.org> wrote on 2025-08-17 at 16:25:59:

> I've only just recently discovered privoxy and I thought I'll give it a try!

Great.

> One thing I can't get to work though is external filters (perhaps any
> filters at all?).
> I stripped down the config as much as possible, my user.action and
> user.filter files look like this:
> user.action:
> { +external-filter{my-filter} }
> /
> 
> user.filter:
> EXTERNAL-FILTER: my-filter why you no work?
> /usr/bin/tee /var/tmp/privoxy/out
> 
> When I run privoxy with: --no-daemon /etc/privoxy/config
> and run the following: curl --proxy localhost:8118 https://www.privoxy.org/
> I get the following output:
> 2025-08-17 15:01:41.411 7ad19d4f0740 Info: Privoxy version 4.0.0
> 2025-08-17 15:01:41.411 7ad19d4f0740 Info: Program name:
> /workdir/privoxy/privoxy
> 2025-08-17 15:01:41.413 7ad19d4f0740 Error: Config option single-threaded
> disables connection keep-alive.
> 2025-08-17 15:01:41.413 7ad19d4f0740 Info: Loading filter file:
> /etc/privoxy/user.filter
> 2025-08-17 15:01:41.413 7ad19d4f0740 Re-Filter: Reading in filter
> "timed-filter" ("why you no work?")
> 2025-08-17 15:01:41.413 7ad19d4f0740 Info: Loading actions file:
> /etc/privoxy/user.action
> 2025-08-17 15:01:41.413 7ad19d4f0740 Info: Listening on port 8118 on IP
> address 0.0.0.0
> 2025-08-17 15:01:48.322 7ad19d4f0740 Request: www.privoxy.org:443/
> 2025-08-17 15:01:48.322 7ad19d4f0740 Actions: +external-filter{my-filter}
> 
> This deceptively shows that it executes my-filter, but it never actually
> runs the tee command, the file under /var/tmp/privoxy never appeared.

Actually the "Actions:" message only shows that the external-filter{} action
"applies".

To actually execute any filters Privoxy has to buffer the content and it
looks like you didn't enable HTTPS inspection so Privoxy isn't doing that.
 
> I got to the point where I built privoxy from source (the v_4_0_0 tag) with
> debug symbols and ran it under gdb.
> I set various breakpoints in handle_established_connection, but couldn't
> really figure out what is going wrong. What I noticed is that the variable
> buffer_and_filter_content which guards the call to execute_content_filters
> is only ever set where it is declared. The main loop in
> handle_established_connection exits after a couple of iterations when it
> runs onto the break statement at line 3413. As far as I can tell the only
> place where buffer_and_filter_content is possibly set to a nonzero value is
> in line 4111, but execution never reaches this line.
> 
> At this point I'm really out of ideas what to try next...

For a quick test, try a http:// URL.

> Is there some extra config I forgot to set to enable external filters?

As mentioned above, to filter https:// content you have to enable
HTTPS inspection. There's a HOWTO at:
<https://www.privoxy.org/user-manual/howto.html#H2-HTTPS-INSPECTION>

> Is it a header that's behind this?

No.
 
> What should I check for in gdb?

Enabling HTTPS inspection should be sufficient to solve this without
involving gdb.

Don't forget to remove the single-threaded directive again as it results
in poor performance.

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/20250817/df7473bb/attachment.bin>


More information about the Privoxy-users mailing list