Skip to content

Tunnel

Source: src/Cloudflare/Tunnel/Tunnel.ts

A Cloudflare Tunnel that establishes a secure connection from your origin to Cloudflare’s edge.

Basic tunnel

const tunnel = yield* Cloudflare.Tunnel("MyTunnel");
// Run the connector with: cloudflared tunnel run --token <Redacted.value(tunnel.token)>

Tunnel with ingress rules

const tunnel = yield* Cloudflare.Tunnel("Web", {
ingress: [
{ hostname: "app.example.com", service: "http://localhost:3000" },
{ service: "http_status:404" },
],
});