Re: link indirection

Rick Troth (troth@rice.edu)
Wed, 4 May 1994 11:30:35 -0500 (CDT)


> I have a program that runs as an httpd script and produces html from
> database accesses. I would like to add a redirection capability that
> would allow it to generate an URL, pass it to the appropriate server,
> and relay the results back to its own client. To do this I presumably
> have to embed the minimal httpd client functionality of URL-resolving
> into my code. I looked at Mosaic-2.4, and libwww2/HTTP.c seems to be
> the relevant piece, ...

A couple of months ago, I cooked-up a gem I call 'webcat'.
This would do exactly what you want, though ... uh ... I hadn't planned
on giving it out anytime soon. It doesn't use libwww, and should!
The idea was that any number of scripts could use this same thing
to get stuff off the web.

> Thanks. -Stan

Webcat has another feature which I've wanted to mention
for quite some time and never gotten around to: The argument passed
is treated as a local filename first, webcat tries to open the object
with open(). If that fails, then webcat tries a readlink().
The result of readlink(), or argv[1] itself, is passed to the webbish
parts of the code. The idea is that you can have a sym-link like:

riceinfo -> http://riceinfo.rice.edu/

and webcat will follow it.

This has interesting implications for all applications.
If this trick were incorporated into a common open() used by other
ordinarily local apps, think of it! Suddenly GNU EMACS and vi
are both WWW editors (almost).

-- 
Rick Troth <troth@rice.edu>, Rice University, Information Systems