Quick tunnel from NodeJs


I want to start a quick tunnel from my NodeJs application.
Is there any library which can be used to call “cloudflared” binary/utility ?

There’s not any that we maintain / know of.

I doubt there’d be any library for it, considering it is a command line tool, and not some reusable implementation.
If you’ve ever used a ‘library’ that seems to be integrated with a traditionally command line tool (such as FFMPEG libraries on Node.js), they’re actually just invoking that tool using Node’s API. You can use exec or spawn (probably spawn if you’re using quick tunnels) to interact with cloudflared (assuming that it’s installed on the system).

I managed to get this to work in a few minutes:

Just get some error handling in, and you’ll be able to use Quick Tunnels in Node (note that for some reason, cloudflared will send log messages over stream 2 / stderr, instead of stream 1 / stdout.

If you wanna steal that code to get started, it’s here

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.