ReadonlyconnectionNumber of successful tunnel handshakes since connectTunnel was called.
ReadonlydeploymentThe full deployment registration URL:
<proxyUrl>/http/in-process/9080/ — register this with
restate dep register <url> (or the UI) once the tunnel is
ready. undefined until the first successful handshake.
The /http/in-process/9080/ destination segment is a constant: an
in-process tunnel terminates at this very process, so the destination
is never dialed and plays no routing role — the deployment's identity
is the tunnelName earlier in the path.
Built from the handshake-advertised proxy URL; on BYOC clusters where Restate reaches the proxy via a cluster-internal address instead, substitute that base and keep the path.
ReadonlyerrorSet when the tunnel stopped on a non-retryable failure (e.g. the server
answered unauthorized or bad-tunnel-name). Once set, the tunnel no
longer reconnects.
ReadonlyproxyThe public proxy base URL for this tunnel
(<proxy-host>/<env-id>/<tunnel-name>), learned from the most recent
successful handshake. The deployment registration URL is this base plus
a /<scheme>/<host>/<port> destination segment — for an in-process
deployment the destination is vestigial, e.g.
${proxyUrl}/http/in-process/9080. Registering the bare base URL will
not route.
ReadonlyreadyResolves when the first tunnel handshake succeeds; rejects if the tunnel stops on a non-retryable failure before ever connecting. Useful for readiness checks; safe to ignore.
ReadonlytunnelThe tunnel name confirmed by the server in the most recent successful
handshake. undefined until the first handshake completes.
ReadonlytunnelThe tunnel server URL, learned from the most recent successful handshake.
Stop reconnecting, close the current connection, and wait for teardown.
Gracefully drain, then stop. Proactively sends HTTP/2 GOAWAY so Restate
Cloud stops opening new streams, refuses any raced streams with a drain
sentinel, lets in-flight invocations finish — bounded by graceMs
(default ConnectTunnelOptions.drainGraceMs) — and then closes the
session gracefully. If the grace elapses first, the session/socket are
force-closed. The default ConnectTunnelOptions.gracefulShutdown
handler wires this to SIGTERM; close is the abrupt alternative.
Requires ConnectTunnelOptions.supportsClientDrain (the default) to
have been advertised; otherwise it degrades to an abrupt close.
Optionalopts: { graceMs?: number }
Handle returned by connectTunnel.