[Prev][Next][Index][Thread]

Making a converter(proxy) HTTP server with wwwlib?



Just to sound out if I am on the right track and not doing something
that I might regret later, I am posting this notice/status report.
What I am trying to achieve is described by

Client                        Proxy/Converter              The WEB
(requestor)                                            (real WWW server)

          GET URL             (pass through)        GET URL
----------------------------> .............. ------------> ........
                              ..............               ........
                              ..............   HTTP Reply  ........
                              .............. <------------ ........
                                HTServHTTP
                               HTMIMEConvert
                          + the whole converter
                        stacking and type matching
                            stuff sitting here
   application/x-mheg-5       ..............
<---------------------------- ObjectConverter

In my converter, the output stream is going to HTTPReply stream, which
then opens quite many other streams (MakeReplyPipe/HTConLen.c,
HTMIMERq.c/HTMIMERequest, HTTPGen.c/HTTPGenMake,
HTTPRes.c/HTTPResponce), most of which insist on adding some headers
based on achors and requests (and the result is totally incorrect for
me).

I found it very difficult to control these beasts and finally resolved
in making a private copy of HTTPServ.c module, with only one little
addition into HTTPReply_new function:

	    me->transparent = YES;

This disables the creation of all those extra (for my application)
pipelines and gives me a straight backstream to the requesting client.
My application can now safely generate the necessary special reply and
headers.

I am only wondering if I actually missed some control that would have
achieved the same result. If such exists, I wouldn't have to use
private version of HTTPServ.c

--
Markku Savela (msa@hemuli.tte.vtt.fi),     Technical Research Centre of Finland
Multimedia Systems, P.O.Box 1203,FIN-02044 VTT,http://www.vtt.fi/tte/staff/msa/