Copyright © 1999, 2000 Martin Pool.

Using rproxy
************

rproxy listens for requests on a socket, and acts as an HTTP proxy, forwarding them to an upstream server.

Running under inetd
===================

Rather than listening to a socket by itself, rproxy can run inside the inetd ``super-server'' process.  With the -1 option, rproxy will serve a single connection on stdin and stdout. and then exit.  Running under inetd is somewhat less efficient, but it lets inetd provide logging and security features.

Logging
=======

Like most web servers, rproxy emits distinct access and error logs.

The access log contains one line for each request and nothing else, so that it can easily be analysed.

The error log contains a mixture of information about exceptional conditions.  If debug tracing is enabled, then it is also sent to the error log.

Access log format
=================

The format of the access log is upwards-compatible with the W3C common log format.  The quote-delimited, space-separated fields are

 1. client ip address

 2. authentication userid

 3. blank

 4. date

 5. request line

 6. action (pass, encode, or decode)

 7. length of signature

 8. decompressed bytes received from upstream

 9. decompressed bytes sent downstream

 10. compressed bytes received from upstream

 11. compressed bytes sent downstream

 12. MIME Content-Type

If there is no value for a field then it is logged as a hyphen.

For example (with lines broken by backslashes):

     127.0.0.1 - - [06Feb2000:19:53:47 +1100] "GET http:www.linuxcare.com.au HTTP1.0"  \
     decode    0   3075   2068   2116      0

Log destinations
================

By default, both the access and error logs are written to standard error.  This is convenient for testing; for production use it may be more appropriate to send the information elsewhere.

Debug tracing
=============

Various trace channels are available to aid in debugging rproxy or the network.  Output is sent to stderr.

Channels may be turned on using the -D flag, specifying any of these options:

all
     Turn on all available tracing.

http
     The HTTP protocol: ports and connections, headers and requests, and so on.

stream
     Streaming of bulk data.

cache
     Basis-cache management: translation to filenames, ...

proto
     Control of the rproxy protocol: decisions about when to rsync-encode transfers...

For example:

     rproxy -p 3128 -Dhttp -Dcache