Wires the axum Router (gateway endpoints + /healthz + /openapi.json + MCP + custom routes via extra_routes merge ADR-046) and drives hyper's HTTP/1.1 or HTTP/2 connection driver over a single QUIC bidirectional stream. The QUIC-to-hyper bridge wraps the (SendStream, RecvStream) pair as a TokioIo-compatible duplex and feeds it to hyper-util's auto Builder (which auto-detects HTTP/1.1 vs HTTP/2). h3 ALPN is not registered (ADR-044). Route handlers, healthz/decoy logic, openapi.json, the MCP route, and the WS upgrade handler are wired as 501 Not Implemented placeholders for their respective tasks. The router state holds Arc<OperationRegistry> + Arc<dyn IdentityProvider>; the router is built once at construction and cloned per connection (cheap Arc clone). DecoyConfig defaults to NotFound. Adds hyper-util dependency (server, service, tokio features).
17 lines
583 B
Rust
17 lines
583 B
Rust
//! alknet-http: HTTP interface for alknet — serves HTTP/1.1 + HTTP/2 on
|
|
//! standard ALPNs (with WebSocket upgrade for browser bidirectional access)
|
|
//! and hosts the HTTP-backed call-protocol adapters.
|
|
//!
|
|
//! Two roles in one crate (ADR-039): HTTP server (HttpAdapter, a
|
|
//! ProtocolHandler for h2/http1.1 + WS upgrade) and HTTP client host
|
|
//! (from_openapi/from_mcp forwarding, to_openapi/to_mcp projections).
|
|
|
|
pub mod adapters;
|
|
pub mod client;
|
|
pub mod gateway;
|
|
pub mod server;
|
|
pub mod websocket;
|
|
|
|
pub use gateway::GatewayDispatch;
|
|
pub use server::{DecoyConfig, HttpAdapter};
|