Skip to main content

Crate iroh_http_core

Crate iroh_http_core 

Source
Expand description

iroh-http-core — Iroh QUIC endpoint, HTTP/1.1 via hyper, fetch and serve.

This crate owns the Iroh endpoint and wires HTTP/1.1 framing to QUIC streams via hyper. Nothing in here knows about JavaScript.

Re-exports§

pub use client::fetch;
pub use client::raw_connect;
pub use endpoint::CompressionOptions;
pub use endpoint::parse_direct_addrs;
pub use endpoint::ConnectionEvent;
pub use endpoint::DiscoveryOptions;
pub use endpoint::EndpointStats;
pub use endpoint::IrohEndpoint;
pub use endpoint::NetworkingOptions;
pub use endpoint::NodeAddrInfo;
pub use endpoint::NodeOptions;
pub use endpoint::PathInfo;
pub use endpoint::PeerStats;
pub use endpoint::PoolOptions;
pub use endpoint::StreamingOptions;
pub use registry::get_endpoint;
pub use registry::insert_endpoint;
pub use registry::remove_endpoint;
pub use server::respond;
pub use server::serve;
pub use server::serve_with_events;
pub use server::ServeHandle;
pub use server::ServerLimits;
pub use session::session_accept;
pub use session::session_close;
pub use session::session_closed;
pub use session::session_connect;
pub use session::session_create_bidi_stream;
pub use session::session_create_uni_stream;
pub use session::session_max_datagram_size;
pub use session::session_next_bidi_stream;
pub use session::session_next_uni_stream;
pub use session::session_ready;
pub use session::session_recv_datagram;
pub use session::session_remote_id;
pub use session::session_send_datagram;
pub use session::CloseInfo;
pub use stream::BodyReader;
pub use stream::HandleStore;
pub use stream::StoreConfig;

Modules§

client
Outgoing HTTP request — fetch() and raw_connect() implementation.
endpoint
Iroh endpoint lifecycle — create, share, and close.
registry
Global endpoint registry shared by all FFI adapters.
server
Incoming HTTP request — serve() implementation.
session
Session — a QUIC connection to a single remote peer.
stream
Per-endpoint handle store and body channel types.

Structs§

CoreError
Structured error returned by core functions.
FfiDuplexStream
Handles for the two sides of a full-duplex QUIC stream.
FfiResponse
Flat response-head struct that crosses the FFI boundary.
ParsedNodeAddr
Parsed node address from a ticket string, bare node ID, or JSON address info.
RequestPayload
Options passed to the JS serve callback per incoming request.

Enums§

ErrorCode
Machine-readable error codes for the FFI boundary.

Constants§

ALPN
ALPN for the HTTP/1.1-over-QUIC protocol (version 2 wire format).
ALPN_DUPLEX
ALPN for base + bidirectional streaming (duplex/raw_connect).

Functions§

base32_encode
Encode bytes as lowercase RFC 4648 base32 (no padding).
generate_secret_key
Generate a fresh Ed25519 secret key. Returns 32 raw bytes, or Err if the RNG panics.
node_ticket
Generate a ticket string for the given endpoint.
parse_node_addr
Parse a string that may be a bare node ID, a ticket string (JSON-encoded NodeAddrInfo), or a JSON object with id and addrs fields.
public_key_verify
Verify a 64-byte Ed25519 signature against a 32-byte public key. Returns true on success, false on any failure (including panics).
secret_key_sign
Sign arbitrary bytes with a 32-byte Ed25519 secret key. Returns a 64-byte signature, or Err if the underlying crypto panics.