coffeeblack

Work :: Osiris

Osiris image
Code from the HttpConnection class
Download
Language:
Java

In 1999 a construction products company contracted me to transform its Intranet Web site. I needed a way to easily deploy and test servlet code because many of this site’s primary functions ran on Java servlets. The servlet development tools that were available at the time were very rudimentary, so I decided to write a small server called Osiris to run servlets and log the requests and responses they handled.

Over time, I gradually added more features to Osiris to make it a full implementation of the HTTP 1.1 protocol. It provides servlet contexts that implement version 2.2 of the Java Servlets Specification, including request and response filtering. Osiris runs anywhere a JVM can be installed and executed because it is written entirely in Java. In addition to virtual hosts, customizable error messages using XSLT, and a small-scale FTP server implementation, some of Osiris’ more advanced features include:

Byte range requests
Support for HTTP 1.1 requests that use the Range header to signal the server to return a partial content response (status code 206). The partial response bodies are encoded as the Internet media type multipart/byteranges.
Authentication
An implementation of HTTP Basic authentication, with a simple challenge/response credentialing mechanism that can be specified on a per-directory basis.
Chunked transfer encoding
Response entity bodies are encoded using the HTTP 1.1 chunked format by default.
Output compression
Support for response body compression using either the gzip or deflate algorithm.
Caching layer
An in-memory file caching layer that implements the HTTP 1.1 cache rules, so conditional GET or HEAD requests that use the Cache-control header can be fulfilled.

Download

Copyright
© 2001-2010
Scott Martin.
All Rights Reserved.
Valid
XHTML and
CSS.