libWWW 2.14 diffs for proxy support (Kevin Altis)
Date: Fri, 11 Feb 1994 08:46:52 --100
Message-id: <>
Precedence: bulk
From: (Kevin Altis)
To: Multiple recipients of list <>
Subject: libWWW 2.14 diffs for proxy support
X-Listprocessor-Version: 6.0c -- ListProcessor by Anastasios Kotsikonas
Content-Length: 4637
Below is the message Lou Montulli put together to describe the proxy
support for Lynx 2-2. These changes were rolled into the various flavors of
Mosaic (X Mosaic 2.2 has already been released) and libWWW 2.15 which the
CERN folks (Ari and TimBL) are currently working on. Clients based on
libWWW should be able to utilize the changes described below in order to
support a proxy gateway. I'm currently working on actual HTTP transaction
examples to further describe the proxy service.

The main thing to understand about the proxy gateway is that instead of a
partial URL being sent to the HTTP server, which is what we do today when a
client talks directly to an HTTP server, a client must send a full URL
(http://..., gopher://..., ftp://...) to the proxy gateway server, the rest
of the HTTP message is the same. For gopher and ftp, the proxy gateway
server will return the data encapsulated as a MIME content type to the
client like a normal HTTP message. HTTP MIME content types are returned for
all URL requests, regardless of the protocol type of the URL. FTP
directories, Gopher directories, etc. are returned as text/html.


From: (Lou Montulli)
Subject: Re: Firewall gateway solution, exodus
Date: Tue, 1 Feb 94 19:05:06 CST

Per our earlier discussions about using <protocal>_proxy as the
environment variables I have some new diffs:

 This solution will only work with HTTP gateways. These diffs apply to
libWWW 2.14> diff ../WWW2.14/Lib*/I*/HTAccess.c WWW/L*/I*/HTAccess.c
> PUBLIC BOOL using_proxy = NO; /* are we using a proxy gateway? */
<       char * gateway_parameter, *gateway;
>       char * gateway_parameter, *gateway, *proxy;
>       /* search for gateways */
>       /* search for proxy servers */
>       strcpy(gateway_parameter, access);
>         strcat(gateway_parameter, "_proxy");
>       proxy = (char *)getenv(gateway_parameter);
>       if(TRACE && gateway)
>           fprintf(stderr,"Gateway found: %s\n",gateway);
>       if(TRACE && proxy)
>           fprintf(stderr,"proxy server found: %s\n",proxy);
<       if (gateway) {
>       /* make sure the using_proxy variable is false */
>       using_proxy = NO;
>       /* proxy servers have precedence over gateway servers */
>       if(proxy) {
>           char * gatewayed=0;
>             StrAllocCopy(gatewayed,proxy);
>             StrAllocCat(gatewayed,addr);
>             using_proxy = YES;
>             HTAnchor_setPhysical(anchor, gatewayed);
>           free(gatewayed);
>           free(access);
>           access =  HTParse(HTAnchor_physical(anchor),
>               "http:", PARSE_ACCESS);
>       } else if (gateway) {

 I replaced the libWWW version of HTTP.c with
 Xmosaic's version and started changing, so rather than giving
 diffs I'll just describe the changes. :)

 add this to define the global variable:
 extern BOOL using_proxy;    /* are we using an HTTP proxy gateway? */

 add this to remove the first character of the resulting path.
 This is done because the resulting URL of the gateway change
 in HTAccess causes something like these to appear:

 The protocol and host is stripped by the time we reach
 the variable p1 below, by the statement:
 char * p1 = HTParse(arg, "", PARSE_PATH|PARSE_PUNCTUATION);
 so we end up with:

 and we want to send:

     /* if we are using a proxy gateway don't copy in the first slash
      * of say: /gopher://a;lkdjfl;ajdf;lkj/;aldk/adflj
      * so that just gohper://.... is sent.
         strcat(command, p1+1);
         strcat(command, p1);

That should do it.  Now when a gateway definition is used that
gateway should be sent the entire URL of the requested document.

  *           T H E   U N I V E R S I T Y   O F   K A N S A S              *
  *         Lou  MONTULLI @                           *
  *                     ACS Computing Services *
  *     913/864-0436        Ukanvax.bitnet             Lawrence, KS 66044  *
  *             UNIX! Cool! I know that!  Jurassic Park - The Movie        *