Re: External filter never executes
Fabian Keil via Privoxy-users <[email protected]> Sun, 17 Aug 2025 18:43:43 +0200
| Newsgroups | gmane.comp.web.privoxy.user |
|---|---|
| Message-ID | <[email protected]> |
--===============6211610223184971198== Content-Type: multipart/signed; boundary="Sig_/ks8kOy/PIw=5hErY9=4=x6L"; protocol="application/pgp-signature"; micalg=pgp-sha256 --Sig_/ks8kOy/PIw=5hErY9=4=x6L Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Tibor Pataky via Privoxy-users <[email protected]> wrote on 2= 025-08-17 at 16:25:59: > I've only just recently discovered privoxy and I thought I'll give it a t= ry! 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} } > / >=20 > user.filter: > EXTERNAL-FILTER: my-filter why you no work? > /usr/bin/tee /var/tmp/privoxy/out >=20 > When I run privoxy with: --no-daemon /etc/privoxy/config > and run the following: curl --proxy localhost:8118 https://www.privoxy.or= g/ > 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} >=20 > 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. =20 > I got to the point where I built privoxy from source (the v_4_0_0 tag) wi= th > 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. >=20 > 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. =20 > 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 --Sig_/ks8kOy/PIw=5hErY9=4=x6L Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEETzbBfzgWkTZUoehQaRgikYuiNxwFAmiiBr8ACgkQaRgikYui Nxwazg//VBKaiiMMpTDFIgQ0AWZG+FioGZpY7X0QVT05KOB4+p8OKiy5t5pQz32U yQQf2twUXoxdx45PYp8iJYExc/aBa5l6SOFlPOOs94gbGCTk9Lr6z0s1p3wx41ya 0iSiiuKyEnVRaPlq1rNV3oDTdZRN7o6ZxSLlnyz3gjNax0T8ZVBIr6H+7rxBGU5+ pey3TrX/vM9A830qJG/71B/5YO3ggBJpuX4erMtbjVIOZ0NmmF2nHtyA1b3gkviJ 9tV7UiyGpTcFzpxkPmZxDKmwUP2XVjlZKufOWR7rd4Dm1TBPJ1TjnxM/aVkxKx8b qrha2unoHNblXLcVlJVBwrfIhhcaauCkjD5rFFHFHZ+CoQlukxObuePbmFSBw1W0 6f5xg0MSdLJDbUZVckdHPeQ9RKtRm+KuWUYE1Qb13hw0YKrOZn0l/29TG8eWt0N6 GaYfV8JCaxKTmaO7eEjn0KYe7f/vqJJbf+vuLzgHa/h9vTtq1wE+E6UJiu8MJnnv +JPih8I0DFJyCwbKNE3Hmkp1j1/Ib3+YSn8JEURu11lZCst44liMnF30X1h9aAgo kqo/SVn/DTkeFFL6WH8jz0HTXZMizM3tZMdJuWxWHYm2LZpyu1CmMSpdsQynZhjH FxJkyN7b7RdUdfL6jikFGPAskMFUBef7vm4fiLr/WYU9gwtzI1c= =Vt7p -----END PGP SIGNATURE----- --Sig_/ks8kOy/PIw=5hErY9=4=x6L-- --===============6211610223184971198== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Privoxy-users mailing list [email protected] https://lists.privoxy.org/mailman/listinfo/privoxy-users --===============6211610223184971198==--