Skip to content

API reference

Use serve() with a Config for the standard server entrypoint, or Server to embed one worker in an existing event loop. Static type annotations and ASGI message contracts live in h2corn.types, and closed-stream send failures raise SendAfterCloseError.

PageUse it for
Server entrypointsStart a standalone server, embed one in an event loop, or catch SendAfterCloseError.
Configuration typesConstruct Config, RequestPolicy, and option literal types in h2corn.types.
ASGI applications and aliasesAnnotate applications, factories, and send/receive callables from h2corn.types.
Scopes and extensionsWork with headers, state, protocol versions, and extension metadata.
HTTP scope and messagesHandle requests, responses, trailers, and file sending.
WebSocket scope and messagesAccept connections, exchange messages, and close sessions.
Lifespan scope and messagesHandle application startup and shutdown.

For per-option descriptions, defaults, environment variables, and CLI flags, see the Configuration reference.