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 live at the crate root because
15// the generated code emits absolute `crate::<schema>_capnp::…`
16// paths between schemas (e.g. `tunnelrpc` references `metadata`
17// from `quic_metadata_protocol`). Hoisting them keeps the
18// generator output usable verbatim.
19#[allow(
20 clippy::all,
21 unused,
22 non_camel_case_types,
23 non_upper_case_globals,
24 non_snake_case
25)]
26pub mod tunnelrpc_capnp {
27 include!(concat!(env!("OUT_DIR"), "/tunnelrpc_capnp.rs"));
28}
29#[allow(
30 clippy::all,
31 unused,
32 non_camel_case_types,
33 non_upper_case_globals,
34 non_snake_case
35)]
36pub mod quic_metadata_protocol_capnp {
37 include!(concat!(env!("OUT_DIR"), "/quic_metadata_protocol_capnp.rs"));
38}
39
40pub mod api;
41pub mod edge;
42pub mod error;
43pub mod manager;
44pub mod proxy;
45pub mod quic_dial;
46pub mod rpc;
47pub mod stream;
48pub mod supervisor;
49
50pub use error::TunnelError;
51pub use manager::{QuickTunnelHandle, QuickTunnelManager, TunnelMetrics};