Skip to content

tunnel connections promise no longer resolves #8

@marcusglowe

Description

@marcusglowe

First of all, thank you for creating this package.

I've been using the latest version the cloudflared cli and the connections promise coming from tunnel no longer resolves.

pesudo code:

import { tunnel } from 'cloudflared';

async function setupTunnel() {
  const {
    url,
    connections
  } = tunnel({
    '--url': 'localhost:4000'
  });
  await Promise.all(connections); // this promise never resolves
  const url = await pendingUrl;
}

Having tracked down the problem, it appears that the log output has changed and so the regexes are failing to trigger. It seems that I don't need to wait for connections to resolve, but we were previously awaiting connections, as is the case in the tunnels example. For our usecase, awaiting just url seems to be sufficient, however I wanted to report it here in case you'd like to update the example.

I would attempt to fix this for this library, but I don't know if logs are coming from the CLI or are being streamed from a service. If they are coming from the CLI, then updating the regex could result in a breaking change for consumers of this package that have pinned their CLI version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions