1#![deny(unsafe_code)]
16
17pub mod endpoint;
18
19pub(crate) mod ffi;
20pub(crate) mod http;
21
22mod addr;
24mod crypto;
25mod encoding;
26mod error;
27
28pub mod events {
30 pub use crate::http::events::*;
31}
32pub mod registry {
33 pub use crate::ffi::registry::*;
34}
35
36pub use http::body::{Body, BoxError};
38pub use http::client::{fetch_request, FetchError};
39pub use http::server::{
40 serve, serve_connection, serve_with_events, ConnectionServeEnd, ConnectionServeError,
41 ConnectionServeOptions, ConnectionServeResult, ConnectionServeRuntime, RemoteEndpointId,
42 RemoteNodeId, ServeHandle, ServeOptions, DEFAULT_MAX_REQUEST_BODY_BYTES,
43 DEFAULT_MAX_RESPONSE_BODY_BYTES,
44};
45
46pub use ffi::dispatcher::{ffi_serve, ffi_serve_with_callback, respond};
48pub use ffi::fetch::fetch;
49#[allow(clippy::disallowed_types)] pub use ffi::handles::{
51 make_body_channel, BodyReader, HandleStore, ResponseHeadEntry, StoreConfig,
52};
53pub use ffi::session::{CloseInfo, Session};
54#[allow(clippy::disallowed_types)] pub use ffi::types::{FfiDuplexStream, FfiResponse, RequestPayload};
56
57pub use endpoint::{
59 parse_direct_addrs, AddressLookupRemoval, AddressLookupSource, AddressLookupUpsert,
60 AddressLookupUpsertError, ConnectionEvent, DiscoveryOptions, EndpointStats, IrohEndpoint,
61 NetworkingOptions, NodeAddrInfo, NodeOptions, PathInfo, PeerStats, PoolOptions,
62 SourceScopedAddressLookup, StreamingOptions,
63};
64pub use events::TransportEvent;
65pub use http::server::stack::{CompressionOptions, StackConfig};
66pub use registry::{get_endpoint, insert_endpoint, remove_endpoint};
67
68pub use error::{CoreError, ErrorCode};
70
71pub const ALPN: &[u8] = b"iroh-http/2";
75pub const ALPN_DUPLEX: &[u8] = b"iroh-http/2-duplex";
77
78pub const ALPN_STR: &str = "iroh-http/2";
80pub const ALPN_DUPLEX_STR: &str = "iroh-http/2-duplex";
82
83pub const KNOWN_ALPNS: &[&str] = &[ALPN_STR, ALPN_DUPLEX_STR];
85
86pub use crypto::{generate_secret_key, public_key_verify, secret_key_sign};
88
89pub(crate) use encoding::base32_decode;
91pub use encoding::base32_encode;
92
93pub use addr::{node_ticket, parse_node_addr, ParsedNodeAddr};