Skip to content
Sign in

tunnel

v0.3.0

Manage expiring durable leases on authorized public tunnels (in-process OpenTunnel by default, or cloudflared Quick Tunnel child processes). Replaces quick-tunnel.

license: Apache-2.0cloudflareleasesopentunneltunnelwebhooks

Install

bash
iii call compose::add worker=tunnel

Run in your project with the iii engine running. Exact versions are immutable and digest-pinned.

Functions4

tunnel::acquire

Function

Acquire or extend an expiring durable lease for an operator-authorized local target; returns immediately, possibly starting

Request
  • consumer_idstringrequired

    Stable opaque consumer identity; not a credential.

  • expires_atstring· date-timerequired

    Absolute lease expiry in RFC3339, strictly in the future.

  • tunnel_idstring
Response
  • errorstring

    Sanitized lifecycle failure, never raw cloudflared output.

  • generationstringrequired
  • lease_idstringrequired
  • public_urlstring
  • statusstringrequiredenum starting, ready, reconnecting, failed, stopped
  • tunnel_idstringrequired

tunnel::on-changed

Function

Tunnel lifecycle snapshot changed. Observe it before acquire, filtered on input.tunnel_id, then read status to close races

Request
  • errorstring

    Sanitized lifecycle failure, never raw cloudflared output.

  • generationstringrequired
  • public_urlstring
  • statusstringrequiredenum starting, ready, reconnecting, failed, stopped
  • tunnel_idstringrequired
Response
  • errorstring

    Sanitized lifecycle failure, never raw cloudflared output.

  • generationstringrequired
  • public_urlstring
  • statusstringrequiredenum starting, ready, reconnecting, failed, stopped
  • tunnel_idstringrequired

tunnel::release

Function

Release one lease idempotently; the last lease stops and reaps the tunnel child

Request
  • lease_idstringrequired
Response
  • releasedbooleanrequired

tunnel::status

Function

Read the latest tunnel generation, connection state, public URL and non-secret leases

Request
  • tunnel_idstring
Response
  • errorstring

    Sanitized lifecycle failure, never raw cloudflared output.

  • generationstringrequired
  • leasesobject[]required
    • consumer_idstringrequired
    • expires_atstring· date-timerequired
    • lease_idstringrequired
    • proxy_protocolstring

      The PROXY mode the lease was granted under; a boot with another mode drops it.

    • tunnel_idstringrequired
  • prerequisitesany of

    Whether the operator-provided cloudflared is usable, and where to get it.

    any of (2)
    Variant 1
    • cloudflaredobjectrequired
      Show 5 nested
      • errorstring

        Why it is not usable, when `found` is false.

      • foundbooleanrequired

        True when an executable was found and answered `--version`.

      • install_urlstringrequired

        Where to install it from; tunnel never installs it.

      • pathstring

        Absolute path tunnel runs.

      • versionstring

        First line of `cloudflared --version`.

    Variant 2
    valuenull
  • providerall of

    Omitted for cloudflared, so its JSON is what older versions sent.

    all of (1)
    Variant 1
    one of (2)
    Variant 1
    valuestringenum cloudflared
    Variant 2
    valuestringenum opentunnel
  • public_urlstring
  • statusstringrequiredenum starting, ready, reconnecting, failed, stopped
  • tunnel_idstringrequired

Search the registry

Find workers, kits and executables, or jump to a page.