Re: Making a converter(proxy) HTTP server with wwwlib?

Markku Savela writes:
> Hi,
> We have a need to map all of the WWW to a totally different format (to
> be specific: MHEG-5). While poking around, the following idea pops up
> - use a proxy server concept, but
> - when a request is served and retrieved from the real WEB server, do
>   not pass the reply directly to the requestor, but run it trhough
>   conversion and always return something like "application/x-mheg-5"
>   to the requestor with the converted octet stream.
> The advantage is that, for the testing purposes, we can use the
> existing WEB clients to do the mundane details of communicating with
> the converter (of course, without helper application for
> appication/x-mheg-5, they can only store the stream).
> By a quick look at the MiniServ, it seems that there is no way to get
> my own stream converter stacks attached to the new request stream that
> carries the reply to requestor (in HTTPServ.c/ParseRequest), or is
> there?

In the version that I am working on you _can_ do conversion of the dat format 
of the data object on the fly. Its is basically the due to the POSTWeb model 
which allows for on-the-fly data conversions when transferring data from one 
request to another.

> Will the normal converters actually work? That is, if I have something
> like
>   HTConversion_add(conv,"text/*","*/*", TextObject, 1.0,0.0,0.0);
>   HTConversion_add(conv,"image/*","*/*", ImageObject, 1.0,0.0,0.0);
>   HTConversion_add(conv,"message/rfc822","*/*", HTMIMEConvert,1.0,0.0,0.0);
> and I do (as in MiniServ)
>   HTFormat_setConversion(conv);
> will my converters actually get called for the "back stream" (reply)
> of the proxied requests? Or, need I set this conversion list to
> request being created on "server_handler" callback? Or, do I need to
> "clone" my own hacked version of the HTTPServ.c module?

Not in the current version of the mini server but in the next one it will :-)


Henrik Frystyk Nielsen, <frystyk@w3.org>
World-Wide Web Consortium, MIT/LCS NE43-356
545 Technology Square, Cambridge MA 02139, USA