Skip to content

Instantly share code, notes, and snippets.

@randyburden
Created July 27, 2022 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save randyburden/cbda4da88bc4e6cd9e17d59ecf03dcf9 to your computer and use it in GitHub Desktop.
Save randyburden/cbda4da88bc4e6cd9e17d59ecf03dcf9 to your computer and use it in GitHub Desktop.
Cloudflare Quick Tunnels - ngrok alternative for exposing localhost ports to the internet

Cloudflare Quick Tunnels

Overview

  • Cloudflare Tunnels has a feature named "Quick Tunnels" that allows you to expose localhost ports to the internet via a dynamically generating unique URL.
  • Cloudflare Quick Tunnels is a free alternative to ngrok, which is a popular developer tool with more features, but does not allow you to have more than 1 instance running at a time without paying, whereas with Cloudflare Quick Tunnels there is no such limit.

Links

Commands

  • Commands Overview
    • After downloading, rename the executable to "cloudflared", then simply execute it from the command-line.
  • Basic Command
    • This command will start a quick tunnel that exposes whatever app you are running on port 8080 to the internet via a dynamically generated URL such as https://some-random-subdomain.trycloudflare.com
      • cloudflared tunnel --url http://localhost:8080
  • Host Header Command
    • Use this command if you run into an "Invalid Host Header" error:
      • cloudflared tunnel --url http://localhost:8080 --http-host-header localhost:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment