CL-HTTP Guided Tour of the Common Lisp Hypermedia Server



The server supports a full range of features.

Content Serving & Generation

You can compute and generate HTML dynamically using computed URLs and the HTML5 generation tools, e.g., View Headers.

HTML5, HTML 4.0, XHTML 1.0, and earlier HTML standards are all supported with backward-compatible generation tools.

Markdown generation with streaming output for LLM responses, and Markdown to HTML translation for Web display.

It can serve images like:

Yosemite Valley.

It can export whole directories of text, HTML, or multimedia at a single directory level or recursively. See CL-HTTP Distribution or standards related to the World Wide Web. Directory exports can be eager or lazy (the default) as needed for start-up time requirements and DNS speed.

Standard abstractions can be adapted to compute pages of interest, such as Basic Icons.

User Input & Presentation

Fill-out Forms and search URLs provide a convenient way to accept user input to functions that compute responses to requests. For example, response functions defined in http:examples;exports.lisp allow you to:

Dynamic computation of fill-out forms allows the queries asked to vary according to the data driving an application such as Computed Form.

The W3P Presentation System provides a portable and fast subset of The Common Lisp Interface Manager, 2.0. All CL-HTTP platforms can use presentation types for presenting and accepting data via HTML fill-out forms, minimizing code duplication while simplifying Web interface coding. The Color Mixer in http:examples;exports.lisp illustrates the use of presentation types.

Image maps are supported with both server-side and client-side variants. Direct image searches allow a response function to invoke functionality based on the coordinates of a mouse click.

Client-side cookies allow an application to maintain user state across HTTP transactions or user sessions.

JavaScript can be embedded in HTML streams using html:with-script and invoked via html:with-event-handlers.

Security & Access Control

IP Subnet security is available globally for the entire server and locally for specific URLs. See HTTP:EXPORT-URL.

Usernames and passwords are available for user authentication, using both the basic and digest authentication methods. View Realms shows the defined realms, users, groups, and URL access groups. See http:examples;access-control.lisp.

TLS 1.3 and TLS 1.2 encryption for server, client, proxy, and Web walker. X.509 client certificate authentication.

Caching & Protocol

Conditional GET is implemented so that caching proxy servers can merely check the headers of a document to see if it has changed rather than reloading it when its expiration time arrives. User control is available via the expiration arguments to HTTP:EXPORT-URL.

HTTP/2 (RFC 9113) with ALPN negotiation, HPACK header compression, multiplexed streams, flow control, and connection pooling. H2 at parity with HTTPS/1.1 throughput on LispWorks and SBCL.

Virtual Hosts are supported on a single IP address. Separate URLs are exported for virtual host and port.

PUT & DELETE Methods for HTTP/1.0 and HTTP/1.1 can be used with any conformant client. Setting Up Web Directories explains how to get started.

Web Walking & Information Retrieval

The W4 Constraint-Guided Web Walker provides a declarative architecture for control and action in a Web robot, with programmable actions, depth/host/content-type constraints, and site maintenance examples (link checking, mirroring). After loading the system (see http:w4;), you can run the example. MCP tools enable LLM-driven crawling and analysis.

The HTML5 Parser provides DOM registry, structured document access, and MCP integration for programmatic and LLM-driven web analysis.

Site Indexing & Information Retrieval is provided by LambdaVista, a hybrid classification and retrieval system. It provides full-text retrieval for CL-HTTP sites, including email HyperArchives.

LLM Integration

The Large Language Model Interface provides a generic interface for interacting with cloud and local LLMs (Anthropic, Google, OpenAI, xAI, LM Studio, Ollama) with chat, streaming, document upload, and conversation history.

The Model Context Protocol (MCP) Server provides 143 tools for LLM-assisted development: evaluation, debugging, profiling, introspection, LMACS s-expression editing, HTML parsing, W4 web walking, and multi-agent collaboration. Available on LispWorks, SBCL, and Symbolics Genera.

Operations & Administration

A modular and extensible logging facility allows Server Log Files to be maintained in any of several formats, including common logfile format. Multiple logs on a single port or different log formats on different ports are supported. The log window example illustrates an interesting extension of logging.

Web-based server configuration allows binary images containing the server to be configured by non-programmers.

The CL-HTTP Mail HyperArchive exports email message archives for public or personal use. See the hyperarchives for WWW-CL@csail.mit.edu. The hyperarchive includes conversation threading and cross references, supports color schemes, and dynamically computes pages directly from a message archive created by an SMTP mailer. Full-text search over messages is available via LambdaVista.

Documentation

The Reference Manual covers all subsystems, with a tutorial for building your first application.

The LispDoc facility dynamically browses all exported operators across all modules.

A Web interface to the Symbolics Document Examiner serves 16,457 topics from 33 Genera manuals.

Working examples in an example Web site to get you started quickly.

Source Code

Common Lisp source code directories are conveniently exported:

  1. Configuration Examples
  2. Portable Server Sources
  3. Portable Client Sources
  4. Portable Proxy Sources
  5. LLM & MCP Sources
  6. HTML Parser Sources
  7. W4 Web Walker Sources
  8. Platform-specific Sources

The object-oriented architecture spans URLs, exceptional conditions, server instances, and authentication objects — built on the CLOS meta-object protocol.


John C. Mallery -- M.I.T. Computer Science & Artificial Intelligence Laboratory