e-httpxfer

e-tunity

2002

e-httpxfer is a HTTP request transfer utility. This document describes how the uses of e-httpxfer, how it is installed, and how it is configured.

Table of Contents

1: Introduction

2: Invocation of e-httpxfer

3: Installing e-httpxfer

3.1: Compilation and installation

4: Configuration

4.1: Network configuration

4.1.1: Configuring the inetd mode
4.1.2: Configuring the daemon mode

4.2: The configuration file

5: Performance issues



1: Introduction

e-httpxfer is a utility which is used to catch HTTP request, to re-route those requests to a given (pre-defined) location, to collect all data there, and to send back the data to the originator.

The general working of e-httpxfer is explained below:

Using this approach, e-httpxfer is ideal as a handler on a public system, and can be used to handle requests to multiple "hidden" webservers, which themselves may be located e.g. in a LAN, unreachable by a direct connection.

e-httpxfer can be best described as a very light-weight and configurable proxy for HTTP traffic.

2: Invocation of e-httpxfer

Througout this document, flags of e-httpxfer will be mentioned. The full explanation is given here.

The invocation of e-httpxfer is e-httpxfer flags. No non-flag arguments are allowed. The supported flags are shown when e-httpxfer is started with an argument, as in e-httpxfer x. The flags are also discussed below.

3: Installing e-httpxfer

3.1: Compilation and installation

To build e-httpxfer, the following e-tunity packages are necessary:

Once the support packages e-lib, epp-lib and misc are available and installed, e-httpxfer compiles and installs out-of-the-box.

4: Configuration

Configuring and using e-httpxfer is a two-step process: first, e-httpxfer is bound to the HTTP port of a server (port 80). Second, its internal configuration file must be adapted.

4.1: Network configuration

e-httpxfer knows two operating modes: an inetd-based single shot mode, and a server (daemon) mode.

4.1.1: Configuring the inetd mode

To enable e-httpxfer as a "service" at port 80, two files must be changed by the superuser (root): /etc/services and /etc/inetd.conf. The changes in /etc/services are:


     # service	port/type
     httpxfer	80/tcp

Note that other predefined services for port 80, type tcp, may co-exist as far as the file /etc/services is concerned.

The changes in /etc/inetd.conf are:


     # service  net type   state.max   user path to binary
     httpxfer   stream tcp nowait.1000 root /usr/e/bin/e-httpxfer e-httpxfer

Note that in inetd.conf, only one service for port 80 may be present. E.g., if services also defines a service www, for port 80, then the line staring with www in /etc/inetd.conf must be either deleted or commented out.

Once the files /etc/services and /etc/inetd.conf are changed, the daemon inetd must be restarted, typically using killall -1 inetd.

4.1.2: Configuring the daemon mode

The startup of e-httpxfer as daemon only requires the presence of a flag -dport, thereby instructing e-httpxfer to bind to the specified port. Often a start script in or under /etc/rc.d/ will be necessary.

4.2: The configuration file

e-httpxfer's configuration file by default resides in /usr/e/etc/e-httpxfer.rc, though a different path may be specified using the switch "-r alternate-file". If needed, this switch must be stated in /etc/inetd.conf or in e-httpxfer's start script.

The configuration file is a list of two- or three column entries. The first column specifies a host setting received HTTP request. When e-httpxfer matches this host setting, then the second column entry is taken as the webserver to connect to. When present, a third column specifies options to e-httprequest that apply to only this host entry.

An example is given below:


     # Requests for...	    should go to...	using optional flags
     e-tunity.com	    192.168.1.50
     www.e-tunity.com	    192.168.1.50

     e-tunity.com:81	    192.168.1.50:81
     
     e-tunity.net	    192.168.1.100	/usr/e/bin/e-httpxfer \ 
			e-httpxfer -v -a /tmp/act-net.log
     www.e-tunity.net	    192.168.1.100	/usr/e/bin/e-httpxfer \ 
			e-httpxfer -v -a /tmp/act-net.log
     
     e-tunity.nl	    192.168.1.100:81
     www.e-tunity.nl	    192.168.1.100:81

     default		    192.168.1.80

The sample entries are:

This example of course assumes that the requests to e-tunity.com, e-tunity.net etc., all arrive at the server where e-httpxfer is installed. This is a DNS-issue and is not further discussed here.

5: Performance issues

As far as the performance is concerned, the following rules of thumb apply.