CL-HTTP Reference Manual
CL-HTTP is a comprehensive HTTP server, client, and web application
framework for Common Lisp, developed since 1994 at the MIT Computer
Science & Artificial Intelligence Laboratory by John C. Mallery.
It provides a complete, object-oriented platform for building dynamic
web applications, supporting HTTP/1.0, HTTP/1.1, HTTP/2, and SSL/TLS.
CL-HTTP runs on multiple Common Lisp implementations including
LispWorks, SBCL, and Symbolics Genera.
Table of Contents
Part I: Introduction and Architecture
- Chapter 1. CL-HTTP Overview
- Design philosophy, package architecture, directory structure, supported platforms, feature flags.
Part II: Getting Started
- Chapter 2. Installation and Configuration
- Logical pathnames, system loading, starting and stopping service, SSL/TLS, key variables.
- Chapter 3. Your First Application
- Static files, computed URLs, search URLs, forms, HTML generation, authentication, redirects.
Part III: Server Core
- Chapter 4. URL System
- URL class hierarchy, interning, export types, accessors, search parsers, translation.
- Chapter 5. HTTP Server
- Request/response pipeline, response macros, HTTP/2, condition handling, cookies, logging, server push (SSE), user-agent capabilities.
- Chapter 6. WebSockets
- RFC 6455 sessions: the
:websocket export type, the message
loop, subprotocols, origins and authentication, keepalive and shutdown, the
WebSocket client, RFC 8441 sessions over HTTP/2, the ws: and wss: schemes,
close codes.
- Chapter 7. HTML Generation
- HTML2 through HTML5 macros: structure, text, links, tables, forms, scripts.
- Chapter 8. Authentication and Access Control
- Realms, users, groups, basic/digest/X.509 authentication, subnet restrictions.
- Chapter 9. Data Caching and Performance
- Data cache, expiration, conditional GET, resource pooling, performance guidelines.
Part IV: Client and Proxy
- Chapter 10. HTTP Client
- GET/POST/PUT/DELETE, headers, authentication, SSL/TLS, HTTP/2 client, connections.
- Chapter 11. Proxy Server
- Caching proxy, reverse proxy, SSL proxy, recovering the real client
IP behind an external reverse proxy (Caddy / nginx / HAProxy), emitting
forwarding headers upstream, access control.
Part V: Subsystems
- Chapter 12. W3P Presentation System
- Presentation types, present/accept, built-in types, custom types.
- Chapter 13. Dynamic Forms
- Declarative forms over W3P: queries, forms, validation with automatic retry,
branching surveys, subject-line commands, text view.
- Chapter 14. W4 Web Walker
- Constraint-guided web crawling, activities, actions, walking programmatically.
- Chapter 15. HTML Parser
- Parsing HTML documents, DOM access, DTD support, integration with W4.
- Chapter 16. Lambda-IR Information Retrieval
- Document universes, tokenization, indexing, constraint-based search, LambdaVista.
Part VI: Advanced Topics
- Chapter 17. SMTP Mail
- Sending email, SMTP configuration, error handling.
- Chapter 18. Server-Parsed HTML and CGI
- SHTML templates, CGI gateway, cookies, content negotiation.
- Chapter 19. Extending CL-HTTP
- Custom export types, URL classes, stream handling, new protocols, porting.
Part VII: Appendices
- Appendix A. Quick Reference
- Key functions and macros by task.
- Appendix B. Condition Hierarchy
- Network and HTTP condition tree with restarts.
- Appendix C. Export Type Reference
- All export-url types with parameters.
- Appendix D. HTML Macro Reference
- All HTML generation macros by category and version.