Expand description
POST /tunnel client for api.trycloudflare.com.
Returns the credentials the edge expects on the subsequent
RegisterConnection RPC: a UUID-shaped id, the public
hostname (<sub>.trycloudflare.com), the account_tag to
quote on RPC, and 32 random bytes of secret that double as the
TunnelSecret in the auth blob.
Mirrors cmd/cloudflared/tunnel/quick_tunnel.go upstream.
Structs§
- Quick
Tunnel - The bits the QUIC + capnp-RPC dance needs.
- Quick
Tunnel Response - Public-facing JSON envelope returned by
POST /tunnel.
Constants§
- DEFAULT_
HTTP_ TIMEOUT - HTTP-level deadline for the POST.
- DEFAULT_
SERVICE_ URL - Default endpoint (the public trycloudflare API).
- DEFAULT_
USER_ AGENT - User-Agent we send. Mimic a recent
cloudflaredso the edge doesn’t trip a novelty filter. Bump in lockstep with the schema commit pinned inTHIRD_PARTY_NOTICES.md. - MAX_
RETRIES - How many times to retry on transient 5xx / network errors.
Functions§
- request_
tunnel - Fetch a fresh quick-tunnel handshake. Retries 5xx + network
errors with exponential backoff (1s → 2s → 4s); never retries
4xx. Business errors inside a 200 response surface as
TunnelError::ApiBusiness.