cloudflare_quick_tunnel/lib.rs
1//! `cloudflare-quick-tunnel` — pure-Rust client for Cloudflare's
2//! `https://*.trycloudflare.com` "quick tunnel" service.
3//!
4//! Drop-in replacement for the common pattern of spawning the
5//! `cloudflared` Go binary as a subprocess and scraping its stderr
6//! for the public URL. Speaks QUIC + Cap'n Proto-RPC to the
7//! `argotunnel` edge natively, so the host application stays a
8//! single self-contained Rust binary.
9//!
10//! See `docs/spike-verdict.md` for the design decision record and
11//! the three undocumented edge gotchas (ALPN / SNI / trust roots)
12//! that the spike crate proved out against the production edge.
13
14// Cap'n Proto-generated bindings. Shipped pre-generated under
15// `src/proto_gen/` so consumers don't need the `capnp` toolchain
16// on their host to build this crate. Regenerate with
17// `scripts/regen-schemas.sh` after bumping the vendored schemas
18// in `schemas/`.
19//
20// They live at the crate root because the generator emits absolute
21// `crate::<schema>_capnp::…` paths between schemas — hoisting them
22// keeps the output usable verbatim.
23#[allow(
24 clippy::all,
25 unused,
26 non_camel_case_types,
27 non_upper_case_globals,
28 non_snake_case
29)]
30pub mod tunnelrpc_capnp {
31 include!("proto_gen/tunnelrpc_capnp.rs");
32}
33#[allow(
34 clippy::all,
35 unused,
36 non_camel_case_types,
37 non_upper_case_globals,
38 non_snake_case
39)]
40pub mod quic_metadata_protocol_capnp {
41 include!("proto_gen/quic_metadata_protocol_capnp.rs");
42}
43
44pub mod api;
45pub mod edge;
46pub mod error;
47pub mod manager;
48pub mod pool;
49pub mod proxy;
50pub mod quic_dial;
51pub mod rpc;
52pub mod stream;
53pub mod supervisor;
54
55pub use error::TunnelError;
56pub use manager::{QuickTunnelHandle, QuickTunnelManager, TunnelMetrics};