HTTPPD

Synopsis

HTTPPD [/?] [/SRV_SUPERDOMAINS number]] [/SRV_SELF number]] [/IMPLICIT[+|-]] [/IP6ADDR[+|-]] [/CLIENTIP[+|-]] [/CLIENTPORT[+|-]] socket

Description

HTTPPD provides HTTP proxy service, accepting HTTP queries on its input and sending HTTP responses on its output. If no socket is specified as an argument, it uses its standard input and standard output for input and output. Otherwise, it uses the named socket, which it closes when it has finished with it. The IP address and TCP port number on which proxy HTTP service is thus provided is determined by its parent process, not HTTPPD itself. Conventionally, the port number is 80 and the IP address is one that is reachable by Internet at large.

HTTPPD is designed to be spawned on demand by TCPSRUN. It can also be spawned by INETD, although the control of client access levels based upon the client's IP address, which TCPSRUN does, will be unavailable as a consequence.

Where client access is denied, HTTPPD simply exits immediately, closing the socket. With any other access level, normal HTTP service is provided.

HTTPPD writes log information to its standard error, listing each request that is processed.

HTTP transactions

HTTPPD accepts GET and HEAD requests. In response to any other request it issues an error response and terminates. The GET and HEAD requests may be in HTTP/1.0 or HTTP/1.1 format. It satisfies each request by making a back-end HTTP transaction with a content server. It passes through the response from the content server to the original client.

HTTPPD, like several other proxy HTTP server softwares, supports the X-Forwarded-For: extension to HTTP, including it in back-end HTTP requests.

HTTPPD supports HTTP pipelining if a client makes a HTTP version 1.1 request. If the client holds the connection open, HTTPPD will attempt to hold the back-end server connection open as well, so that multiple requests may be made over a single connection. (If the back-end content HTTP server does not support HTTP 1.1, this is not possible.)

Locating content HTTP servers

HTTPPD is SRV resource record aware.

HTTPPD locates servers from the URLs supplied (in requests) in the normal way, using http as the service name, tcp as the transport name, and 80 as the well-known port number.

It attempts to connect to the servers found, using the weightings and fallback priorities specified for them, until it finds one that it can connect to. It thus obeys load balancing and fallback instructions specified by content providers.

HTTPPD is thus a remedy for a deficiency that has existed in some WWW browsers for more than ten years. If a WWW browser is directed to use a HTTPPD proxy server, it effectively becomes SRV record aware.

Example RUN file

A "TCPService.RUN" run file, for HTTPPD to be spawned by TCPSRUN, would typically look similar to:

  program %APPS%\JdeBP\IU\Bin\HTTPPD.exe
  argument HTTPPD
  argument %3

TCPSRUN itself would be invoked under RUNSVC, the Service Manager in the OS/2 Command Line Utilities version 2.2, with a run file similar to:

  program %APPS%\JdeBP\IU\bin\TCPSRun.exe
  chdir %_BOOT%:\Config\Services\%1
  argument TCPSRun
  argument 0.0.0.0
  argument 8080
  argument TCPService.RUN

Command-specific options


The Internet Utilities are © Copyright Jonathan de Boyne Pollard. "Moral" rights are asserted.