Re: unable to include a simple filter

On Fri, 8 Sep 2000, senthilvasan wrote:

> Hi,
> 
> I want to use the proxy server
> 
> "Jigsaw Proxy Package (based on 2.0.2 - 5th May 1999 devel release)"
> 
> with which I want to filter and replace one HTML tag contents. How do I do
> it. Can I get some sample code and the steps to include the filter in the
> proxy? I found the documentation for proxy server is less.

There are two kinds of filter, the server-side ones, and the client-side
one. The cache filter and proxy dispatcher filter are examples of
client-side filters.
Do you want your filter to affect the whole server (if configured to act
as a proxy AND a server)?
If so, then the easiest way is to use the server-side filter API.
You just have to do the outgoingFilter (see
http://www.w3.org/Jigsaw/Doc/Programmer/writing-filters.html)
check that the MimeType (if present) is text/html, then get the stream,
filter it, change the Content-Lenght (put -1 if you don't know what the
size will be), and set the stream of the reply to be your filtered stream.
Of course you should switch to 2.0.5 or 2.1.2 (2.1.2 handles HTTP/1.0 and
0.9 while 2.0.5 doesn't support HTTP/0.9, unless you get a devel version).
Regards,

      /\          - Yves Lafon - World Wide Web Consortium - 
  /\ /  \        Architecture Domain - Jigsaw Activity Leader
 /  \    \/\    
/    \   /  \   http://www.w3.org/People/Lafon - ylafon@w3.org    

Received on Tuesday, 12 September 2000 05:07:56 UTC