http2

2025-06-22

Otherwise empty system that depends on - and thus loads when loaded - both HTTP/2 client and HTTP/2 server. The system also supports TEST-OP to run the test suite.

Upstream URL

github.com/zellerin/http2

Author

Tomáš Zellerin <tomas@zellerin.cz>

License

MIT
README
HTTP/2 in Common Lisp

https://github.com/zellerin/http2/actions/workflows/test.yml/badge.svg

This is an implementation of HTTP/2 protocol as described in RFC9113 (and RFC7540 before) and RFC7541 (HPACK). It provides both high-level interface as well as ways to fine tune its behaviour for better performance or specific use cases.

For quick start, quickload "http2" and run

  (http2/client:retrieve-url "https://example.com")
to fetch a HTTP/2 resource, and
  (http2/server:start 8443)

  (define-exact-handler "/" (send-text-handler "Hello World"))
to start an empty TLS server and serve a "Hello world" page.

Check tutorials that show in more detail how to use the client or the server.

0.1Status

In quicklisp. Documentation on separate page.

Implements both thread-per-client and poll-based single threaded server (that may be actually faster).

Tested primarily on sbcl, occasionally on ecl.

Almost all parts of the listed standards implemented, not necessary documented or declared stable

0.2Missing pieces

  • No handling of priorities is implemented. This is more or less OK, as these areonly suggestions, and they are more or less dropped in RFC9113 anyway. Butnothing from RFC9218 is implemented neither (except for the setting).
  • Push promises are not implemented in the client. This is OK, they are disabledby default (settings)
  • The MAX-HEADER-LIST-SIZE limit is not enforced, but it is declared as anadvisory setting anyway.
  • Some checks on behaviour of the peer are not enforced
  • The ping and setting frames are not automatically prioritized (they arereplied as soon as processed, but nothing prevent finishing long responsebefore that)

0.3Dependencies

The core library used trivial-gray-streams to implement streams over data frames.

Client and server - or at least some server versions - require usocket and cl+ssl to talk over TLS, and bordeaux-threads for concurrency.

Client and server use puri to manipulate URLs.

Server also uses cffi directly to check and confirm alpn

Documentation is done with mgl-pax.

Additionally, fiasco is used for testing (and Javascript for browser-side testing).

0.4Speed & scaling

The code was not written with speed as primary concern. Measurements depend onmany tunable factor both on the client and the server (including platform).

Anyway, run or modify the speed test code for your results.

sbcl --script scaffolding/speed-test.lisp

0.5License

Licensed by MIT license.

Some comments are taken over from the RFCs above and copyrighted by RFC contributors. I read the copyright licenses for RFC that this is allowed.

0.6Related software

There is an Akamai code on https://github.com/akamai/cl-http2-protocol thatsupported bigger parts of the drafted HTTP/2 protocol in 2014; apparently hardif not impossible to run now. It used NPN instead of ALPN.

Dependencies (16)

  • alexandria
  • anaphora
  • bordeaux-threads
  • cffi
  • chipz
  • cl+ssl
  • cl-who
  • fiasco
  • flexi-streams
  • gzip-stream
  • let-over-lambda
  • mgl-pax
  • parenscript
  • puri
  • trivial-gray-streams
  • trivial-utf-8

Dependents (0)

    • GitHub
    • Quicklisp