How python-hyper/h11 works
h11 is a pure-Python, bring-your-own-I/O HTTP/1.1 protocol library, not a network client or server. An application feeds received bytes to a Connection and consumes parsed events; to send, it supplies events and writes the returned bytes through its own I/O layer. Connection coordinates role-aware protocol state, parsing, and serialization, covering message framing, headers, keep-alive, and protocol switching. The graph reflects README-described behavior and sampled imports; unsampled implementation details are not inferred.
Main entry points: _connection.py Connection · __init__.py Public API · _readers.py Message Readers · _headers.py Header Handling
Components 12
Public API
- Public API
h11/__init__.py - Version Metadata
h11/_version.py
Protocol Engine
- Connection
h11/_connection.py - HTTP Events
h11/_events.py - Connection State
h11/_state.py - Message Readers
h11/_readers.py - Message Writers
h11/_writers.py
Parsing and Validation
- Receive Buffer
h11/_receivebuffer.py - Header Handling
h11/_headers.py - HTTP Grammar
h11/_abnf.py - Protocol Utilities
h11/_util.py
Other components
- Application / I/O
Connections 24
- Application / I/O → Public API: uses API
README.rst - Public API → Connection: exposes
h11/__init__.py - Public API → HTTP Events: exposes
h11/__init__.py - Public API → Connection State: exposes roles
h11/__init__.py - Public API → Protocol Utilities: exposes errors
h11/__init__.py - Public API → Version Metadata: uses version
h11/__init__.py - Application / I/O → Connection: passes bytes/events
README.rst - Connection → Connection State: checks transitions
h11/_connection.py - Connection → HTTP Events: processes events
h11/_connection.py - Connection → Message Readers: dispatches parsing
h11/_connection.py - Connection → Message Writers: dispatches serialization
h11/_connection.py - Message Readers → Receive Buffer: consumes bytes
h11/_readers.py - Message Readers → HTTP Events: creates events
h11/_readers.py - Message Readers → Header Handling: parses headers
h11/_readers.py - Message Writers → HTTP Events: serializes events
h11/_writers.py - Message Writers → Header Handling: writes headers
h11/_writers.py - Message Writers → Connection State: selects by state
h11/_writers.py - HTTP Events → Header Handling: normalizes headers
h11/_events.py - Header Handling → HTTP Grammar: validates grammar
h11/_headers.py - Header Handling → Protocol Utilities: converts and validates
h11/_headers.py - Message Readers → HTTP Grammar: matches syntax
h11/_readers.py - Message Readers → Connection State: selects by state
h11/_readers.py - Connection → Receive Buffer: buffers input
h11/_connection.py - Connection → Protocol Utilities: translates errors
h11/_connection.py