How dqsjqian/mira works
Mira is a C++23 coroutine networking library, not an application framework. Its principal workflow is for an application to compose an asynchronous transport with an optional TLS layer and a protocol implementation, then exchange data with a peer. Core provides the shared execution and stream contracts; transport handles TCP, UDP, and DNS; protocol stages cover HTTP/1, WebSocket, HTTP/2, and QUIC/HTTP/3. README capabilities are included where implementation excerpts were unavailable; those unsampled areas are not given speculative internal call links.
Main entry points: core/stream.hpp Async stream contract · tls/stream.hpp TLS stream · tcp.hpp TCP sockets and listener · engine.hpp HTTP/3 engine
Components 20
Core runtime
- Tasks and event loop
modules/core/include/mira/core/event_loop.hpp - Async stream contract
modules/core/include/mira/core/stream.hpp
Transport
- TCP sockets and listener
modules/transport/include/mira/transport/tcp.hpp - UDP datagrams
modules/transport/include/mira/transport/udp.hpp - DNS resolver
modules/transport/include/mira/transport/resolver.hpp - Bounded TCP serving
modules/transport/include/mira/transport/server.hpp
Security
- TLS context
modules/tls/include/mira/tls/context.hpp - TLS stream
modules/tls/include/mira/tls/stream.hpp - TLS state machine
modules/tls/include/mira/tls/engine.hpp - Crypto utilities
modules/crypto/include/mira/crypto/crypto.hpp
Protocols
- QUIC engine
modules/quic/include/mira/quic/engine.hpp - QUIC listener
modules/quic/include/mira/quic/listener.hpp
Web protocols
- HTTP/1 parsing and service
modules/http/include/mira/http/parser.hpp - HTTP client
modules/http/include/mira/http/client.hpp - WebSocket protocol
modules/ws/include/mira/ws/connection.hpp - HTTP/2 sessions
modules/http2/include/mira/http2/session.hpp - HTTP/3 engine
modules/http3/include/mira/http3/engine.hpp - HTTP/3 server
modules/http3/include/mira/http3/server.hpp
Other components
- Application
- Network peer
Connections 26
- Application → Tasks and event loop: composes
- Application → TCP sockets and listener: composes
- Application → UDP datagrams: composes
- Application → HTTP/1 parsing and service: composes
- Application → TLS stream: composes
- Tasks and event loop → Async stream contract: supports
- TCP sockets and listener → Async stream contract: implements
- TLS stream → Async stream contract: implements
- TLS stream → TLS state machine: drives
- TLS stream → TLS context: uses
- TLS stream → TCP sockets and listener: wraps
- TLS context → Crypto utilities: uses
- HTTP/1 parsing and service → Async stream contract: uses
- HTTP client → Async stream contract: uses
- WebSocket protocol → Async stream contract: uses
- HTTP/2 sessions → Async stream contract: adapts
- Bounded TCP serving → TCP sockets and listener: accepts
- DNS resolver → Network peer: resolves names
- TCP sockets and listener → Network peer: exchanges bytes
- UDP datagrams → Network peer: exchanges datagrams
- QUIC listener → QUIC engine: creates connections
- QUIC engine → UDP datagrams: uses datagrams
- HTTP/3 engine → QUIC engine: owns transport
- HTTP/3 server → QUIC listener: dispatches
- HTTP/3 server → HTTP/3 engine: creates sessions
- HTTP/3 engine → Network peer: exchanges HTTP/3