[Privoxy-users] External filters problem on Microsoft Windows.

Lee ler762 at gmail.com
Sun Nov 5 17:14:30 UTC 2017


On 11/5/17, yosef atar <atar.yosef at gmail.com> wrote:
> Thanks Lee about your detailed answer.
>
> Your answer make sense especially because when I've tried to add to the
> actions file a file like "+external-filter" Privoxy said that this action
> isn't recognized.

I played with this a bit more, and you can get external-filter working
on a windows machine if you install cygwin & build your own version of
privoxy to run under cygwin.

NOTE WELL: external filters (or any filter for that matter) will not
work on https://  sites


user.filter:
###########################################
EXTERNAL-FILTER: calc  test filter for privoxy.org/
/cygdrive/c/windows/system32/calc.exe


user.action:
################### test
{ +external-filter{calc} }
.privoxy.org/
################### test


config:  (note: config.txt is for windows & cygwin isn't windows)
temporary-directory /tmp/privoxy
debug     1 # Log the destination for each request Privoxy let through.
debug     8 # show header parsing - helpful but verbose
debug    64 # show what filters matched
debug  1024 # Log the destination for each request Privoxy blocked
debug  4096 # Startup banner and warnings
debug  8192 # Non-fatal errors


This is getting way too long, so short version: goto http://www.privoxy.org
2017-11-05 11:57:53.105 6004bf970 Request: www.privoxy.org/
2017-11-05 11:57:53.394 6004bf970 Header: scan: HTTP/1.1 200 OK
2017-11-05 11:57:53.394 6004bf970 Header: scan: Server: nginx/1.10.2
2017-11-05 11:57:53.394 6004bf970 Header: scan: Date: Sun, 05 Nov 2017
16:57:54 GMT
2017-11-05 11:57:53.394 6004bf970 Header: scan: Content-Type: text/html

calc.exe doesn't run, so need to figure out how to get an external
filter applied to text/html files

2017-11-05 11:57:53.417 6004bf970 Header: New HTTP Request-Line: GET
/p_doc.css HTTP/1.1
2017-11-05 11:57:53.417 6004bf970 Request: www.privoxy.org/p_doc.css
2017-11-05 11:57:53.517 6004bf970 Header: scan: HTTP/1.1 200 OK
2017-11-05 11:57:53.517 6004bf970 Header: scan: Server: nginx/1.10.2
2017-11-05 11:57:53.517 6004bf970 Header: scan: Date: Sun, 05 Nov 2017
16:57:54 GMT
2017-11-05 11:57:53.517 6004bf970 Header: scan: Content-Type: text/css
  <.. snip ..>
2017-11-05 11:57:53.519 6004bf970 Re-Filter: Executing 'calc':
/cygdrive/c/windows/system32/calc.exe < /tmp/privoxy/privoxy-1lJNnsIk
2017-11-05 11:57:53.727 6004bf970 Re-Filter: Executing 'calc' resulted
in return value 0. Read 0 of up to 3704 bytes.
2017-11-05 11:57:53.727 6004bf970 Header: Adjusted Content-Length to 0


and the calc.exe window pops up

Regards,
Lee




>
> Regards,
>
> Ataro.
>
>
>
> 2017-11-05 16:52 GMT+02:00 Lee <ler762 at gmail.com>:
>
>> On 11/2/17, yosef atar <atar.yosef at gmail.com> wrote:
>> > Hi there,
>> >
>> > I'm trying to define an external filter in the "user.filter" file but
>> > Privoxy ignore it and emit the following message:
>> >
>> > Error: Ignoring job EXTERNAL-FILTER: socat-test Test socat with SSL.
>> > outside filter block in .\user.filter, line 78
>> >
>> > My filter is defined as following:
>> >
>> > "EXTERNAL-FILTER: socat-test Test socat with SSL.
>> > calc.exe"
>> >
>> > I didn't find in the documentation any reference to "filter blocks".
>> >
>> > Any idea?
>>
>> short version: if you're on windows, external filters aren't implemented
>> yet.
>>
>> long version:
>> open  http://config.privoxy.org/show-status
>> under the 'Conditional #defines:' section
>> if FEATURE_EXTERNAL_FILTERS is No your version of privoxy doesn't do
>> external filters
>>
>> I just tried building privoxy for windows with the external filter
>> functionality enabled:
>> ./configure --host=i686-w64-mingw32 --enable-mingw32 \
>>             --enable-static-linking \
>>             --enable-external-filters \
>>             --disable-pthread  --disable-dynamic-pcre  --enable-zlib \
>>             --with-docbook=yes
>>
>> and it died:
>> i686-w64-mingw32-gcc -fstack-protector-strong -static  -mwindows -o
>> privoxy.exe actions.o cgi.o cgiedit.o cgisimple.o deanimate.o encode.o
>> errlog.o filters.o gateway.o jbsockets.o jcc.o list.o loadcfg.o
>> loaders.o miscutil.o parsers.o ssplit.o urlmatch.o client-tags.o
>> w32log.o w32taskbar.o win32.o w32svrapi.o w32.res pcrs.o pcre/get.o
>> pcre/maketables.o pcre/study.o pcre/pcre.o pcre/pcreposix.o -lws2_32
>> -lz -lwsock32 -lcomctl32
>> filters.o:filters.c:(.text+0x2220): undefined reference to `setenv'
>> collect2: error: ld returned 1 exit status
>> make: *** [GNUmakefile:754: privoxy.exe] Error 1
>>
>>
>> https://cygwin.com/acronyms/#PTC
>>
>> Regards,
>> Lee
>>
>


More information about the Privoxy-users mailing list