You can use Cloudflare infrastructure to expose your local app to the public i.e. for demo purposes or for testing on a device outside your local network.

Prerequisite: install cloudflared.

brew install cloudflared

Example

If you want to expose your app running on port $PORT in local network, run the following:

cloudflared tunnel --url http://localhost:$PORT
  • Your app will be accessible over a random subdomain matching *.trycloudflared.com
  • Check the command output to get the publicly accessible URL
  • You don’t need to be logged in to Cloudflare to use it