Restate Typescript SDK
    Preparing search index...

    Handle returned by connectTunnel.

    interface TunnelConnection {
        connectionCount: number;
        deploymentUrl: string | undefined;
        error: Error | undefined;
        proxyUrl: string | undefined;
        ready: Promise<void>;
        tunnelName: string | undefined;
        tunnelUrl: string | undefined;
        close(): Promise<void>;
        shutdown(opts?: { graceMs?: number }): Promise<void>;
    }
    Index

    Properties

    connectionCount: number

    Number of successful tunnel handshakes since connectTunnel was called.

    deploymentUrl: string | undefined

    The 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.

    error: Error | undefined

    Set 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.

    proxyUrl: string | undefined

    The 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.

    ready: Promise<void>

    Resolves 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.

    tunnelName: string | undefined

    The tunnel name confirmed by the server in the most recent successful handshake. undefined until the first handshake completes.

    tunnelUrl: string | undefined

    The tunnel server URL, learned from the most recent successful handshake.

    Methods