It is possible to change way that www clients to a TCP connect to do all of this for every connection. The code in in HTTP.c and HTTCP.c in the libwww library. This has been done successfully at for example Xerox PARC ands other places.
WWW clients can be set to redirect requests to a gateway using
setenv WWW_http_GATEWAY http://gw.here.com/ setenv WWW_wais_GATEWAY http://gw.here.com/ setenv WWW_gopher_GATEWAY http://gw.here.com/setting it separately for each type of URL. They then use HTTP protocol to go to the gateway, which returns whatever document/search it was they wanted. See also: running a WWW gateway.
The client can in fact run with a rule file instead of the environment variables, which allows more complicated selections to be set up.
The CERN WWW server (httpd) will run as a gateway just by being configured correctly. The rule file needs lines like for example
pass http:* pass wais:* pass gopher:* fail news:alt.* pass news:*The gateway can at the same time be a server for files, by putting in lines like
pass http://gw.here.com/* file:/pub/* pass /* file:/pub/*There are lots of alternatives. Clearly you can be quite specific about what you do and do not want to allow through. But censorship may only get you into trouble with your users. Tim BL 1992