Article delegate-en/287 of [1-5138] on the server localhost:119
  upper oldest olders older1 this newer1 newers latest
search
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
[Reference:<_A259@delegate-en.ML_>]
Newsgroups: mail-lists.delegate-en

[DeleGate-En] HOW TO REWRITE RESPONSE MESSAGES
12 Feb 1999 02:53:38 GMT ysato@etl.go.jp (Yutaka Sato)


On 02/06/99(01:11) you Carlo Todeschini <pamaqbdyi-td4xym6cimhb.ml@ml.delegate.org> wrote
in <_A259@delegate-en.ML_>
 |can I substitute
 |SRC="http://192.168.2.2:11000/-/builtin/icons/ysato/up.gif"
 |with something like SRC="http://www.rccr.cremona.it/news_image/up.gif"

Another solution for your requirement is using "external filter".
You can achive arbitrary rewriting to messages relayed on DeleGate
by filter programs which you attach to your DeleGate.  The filter
program to be applied for response message is specified with the
"FTOCL" parameter.  I take "sed" as an example of filter program
below, but of course you can use any filter programs you have.

1. Primitive usage of an external filter

     FTOCL="sed 's/string1/string2/'"

     - anything (eg. text or binary) to a client will pass through the filter
     - Content-Length will not be adjusted even if changed

2. Using "CFI script" for conditional filtering based on content type

     FTOCL=rewrite.cfi

[rewrite.cfi]
--------------------------------------
#!cfi
Content-Type: text/html
Filter: sed 's/string1/string2/'
--------------------------------------

     + only messages of specified content type will pass the filter
     + applicable to any MIME based message protocols (HTTP, NNTP, POP)
     - whole message with header and body will pass through the filter
     - Content-Length will not be adjusted

3. Using CGI program in CFI

     FTOCL=rewrite.cfi

[rewrite.cfi]
--------------------------------------
#!cfi
Content-Type: text/html
CGI: echo "Content-Type: text/html";
     echo "";
     sed 's/string1/string2/'
--------------------------------------

     + Content-Length will be adjusted
     + can reuse existing CGI program
     - applicable only to HTTP

4. Using CMAP for conditional filtering based on connection information

     CMAP=rewrite.cfi:FTOCL:protoList:dstHostList:srcHostList

     + can restrict appliction of filer to only specified connections

Cheers,
Yutaka
--
Yutaka Sato <ysato@etl.go.jp> http://www.etl.go.jp/~ysato/   @ @ 
Computer Science Division, Electrotechnical Laboratory      ( - )
1-1-4 Umezono, Tsukuba, Ibaraki, 305-8568 Japan            _<   >_

  admin search upper oldest olders older1 this newer1 newers latest
[Top/Up] [oldest] - [Older+chunk] - [Newer+chunk] - [newest + Check]
@_@V