Re: external-filter example
"U.Mutlu" <[email protected]> Thu, 23 Jul 2020 07:44:26 +0200
| Newsgroups | gmane.comp.web.privoxy.user |
|---|---|
| Organization | mutluit.com |
| Message-ID | <[email protected]> |
Lee wrote on 07/23/2020 05:15 AM: > On 7/22/20, U.Mutlu <[email protected]> wrote: >> A working example for such an external-filter would be helpful. >> Unfortunately I couldn't find any on the web :-( > > How about > http://config.privoxy.org/user-manual/actions-file.html#SERVER-HEADER-TAGGER > > Add this to your user.action: > # Tag every request with the content type declared by the server > {+server-header-tagger{content-type}} > / > > # apply myTee filter to all text/html content > { +external-filter{myTee} +force-text-mode} > TAG:^text/html > > and the bit you have in user.filter should be something like > > EXTERNAL-FILTER: myTee make a copy of reveived text > /usr/bin/tee myCopiedText > > maybe that will work? Thx, finally got it working with these settings: file my.filter: EXTERNAL-FILTER: myTee make a copy of reveived text /usr/bin/tee /tmp/myTee_Test.txt file my.action: {{alias}} { +server-header-tagger{content-type} +external-filter{myTee}} / TAG:^text/html But the output is "meager": it always just says "301 Moved Permanently" with all URLs: # cat /tmp/myTee_Test.txt <html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>CloudFront</center> </body> </html> So, it seems the https-MITM isn't working in my build. I had used old version (2.4.2) of mbedtls (that from Debian 8 repo). Lee, you said https-MITM would work with the latest dev version. Does it work due to the newer mbedtls version? Or what else do I need to get the full content of the HTML file? Btw, here are the external-filter examples in doc that was the motivation for my above myTee filter (there the "cat" command etc. is used): https://www.privoxy.org/user-manual/filter-file.html#EXTERNAL-FILTER-SYNTAX