https://github.com/benoitc/livery
High-performance HTTP/1.1, HTTP/2, HTTP/3 server for Erlang/OTP 27+
https://github.com/benoitc/livery
Last synced: 28 days ago
JSON representation
High-performance HTTP/1.1, HTTP/2, HTTP/3 server for Erlang/OTP 27+
- Host: GitHub
- URL: https://github.com/benoitc/livery
- Owner: benoitc
- Created: 2026-02-24T13:22:59.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2026-05-29T23:12:51.000Z (28 days ago)
- Last Synced: 2026-05-30T01:06:35.962Z (28 days ago)
- Language: Erlang
- Size: 718 KB
- Stars: 7
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
Livery
One handler set. Every version of HTTP.
---
Livery is a BEAM-native web framework that serves the same router and
middleware over **HTTP/1.1, HTTP/2, and HTTP/3** from a single
runtime. WebSocket, WebTransport, Server-Sent Events, OpenAPI, MCP,
and OpenTelemetry-style observability are built-in modules. It is
written in the spirit of Axum + Tower + Hyper, on Erlang/OTP.
```erlang
Router = livery_router:compile([
{<<"GET">>, <<"/">>, fun(_Req) ->
livery_resp:text(200, <<"hello from livery">>)
end},
{<<"GET">>, <<"/users/:id">>, {users, show}}
]),
livery:start_service(#{
http => #{port => 80, redirect => https},
https => #{port => 443, cert => Cert, key => Key, alpn => [h2, http1]},
http3 => #{port => 443, cert => Cert, key => Key},
router => Router,
middleware => [{livery_request_id, undefined}, {livery_access_log, #{}}],
alt_svc => advertise
}).
```
## Install
```erlang
%% rebar.config
{deps, [{livery, {git, "https://github.com/benoitc/livery.git", {branch, "main"}}}]}.
```
## Features
- **One handler, three wires** — write a handler once; serve it over
H1, H2, and H3 with shared routing, middleware, and Alt-Svc upgrade.
- **Tower-style middleware** — value-based `call(Req, Next, State)`
pipelines, composable per service or per route.
- **Streaming** — chunked, SSE, NDJSON, WebSocket and WebTransport
over H2/H3, and file responses with byte ranges.
- **OpenAPI** — generate a 3.1 document from routes, serve Redoc or
Swagger UI, and validate request bodies against a JSON-Schema subset.
- **MCP** — serve the Model Context Protocol Streamable HTTP transport
on the main listener.
- **Observability & auth** — OpenTelemetry-style traces/metrics,
trace-correlated logs, JWT/JWKS/OIDC, signed sessions, introspection.
## Documentation
Full guides, tutorials, and the generated API reference live at
****. For contributors, see
[AGENTS.md](AGENTS.md).
## License
Apache-2.0.