ServerHTTP

Fri Jun 05 03:44:58 EDT 2009

This connector creates a socket server on this host, where one or more client applications may connect and transmit HTTP requests. This implementation can support multiple simultaneous clients (if configured so).

This connector will start a socket server on the given local host interface and port number, waiting for data source clients to connect and send HTTP requests. The number of simultaneous connections can be specified by the clients.limit configuration parameter. The default is one. A value greater than one will allow multiple data sources to be multiplexed into one stream. Any subsequent client connection attempts beyond the limit will receive the 503 response code ("Sorry, too many clients. Try again later.").

The Hypertext Transfer Protocol (HTTP/1.1) is defined in RFC 2616 http://www.faqs.org/rfcs/rfc2616.html

Output

All data will be presented in an XML-style format. All header field and parsed parameters will appear as attributes in a "<request>" tag. Note that there may be many other attributes depending on the requesting client, however, the following attributes are guaranteed to be present: QUERY_STRING, REMOTE_ADDR, REMOTE_HOST, REQUEST_METHOD, REQUEST_URL, REQUEST_VERSION. The closing tag will always appear on a separate line. If you specified that POST data should not be parsed (See the description of the isPostDataParsable property.), then that POST data will appear in the body of the tag.

Any caught java.io.IOException will appear in an "<error>" tag.

Examples

Note that in production there are no blank lines between events.
<request HOST="localhost:8080" QUERY_STRING="key1=value1&key2=value2" REMOTE_ADDR="127.0.0.1" REMOTE_HOST="localhost" REQUEST_METHOD="GET" REQUEST_URL="/" REQUEST_VERSION="HTTP/1.1" key1="value1" key2="value2">
</request>

<request HOST="localhost:8080" QUERY_STRING="" REMOTE_ADDR="127.0.0.1" REMOTE_HOST="localhost" REQUEST_METHOD="GET" REQUEST_URL="/" REQUEST_VERSION="HTTP/1.1">
key1=value1&key2=value2
</request>

<request HOST="localhost:8080" QUERY_STRING="" REMOTE_ADDR="127.0.0.1" REMOTE_HOST="localhost" REQUEST_METHOD="GET" REQUEST_URL="/" REQUEST_VERSION="HTTP/1.1">
This is some unconventional POST data, possibly from a proprietary device (not
a browser).  You should set the 'isPostDataParsable' property to 'false' so that
this data appears here (rather than being lost due to parsing errors).
</request>

<error exception="java.io.IOException: Stream closed."/>