Skip to content
--basic-auth

Show localhost to someone else.

A screenshot is not the app. The question you get back is always about the thing the screenshot does not do: what happens when I click that, is it slow, does it work on my machine. Answering it properly means the other person driving the app, and the app is on your machine.

~/app · A client clicking through
$ zgrok http 3000
✓ Online · demo--acme-shop.zgrok.io → localhost:3000
GET/20031 ms
GET/dashboard20044 ms
POST/api/orders20162 ms
GET/settings20028 ms
On this page

The alternative is a deploy you did not want to do

Putting a branch on a staging environment to settle one question is a build, a deploy, and a slot in whatever queue your team has around that environment. It also changes what you are showing: staging has staging's data and staging's configuration, and the thing you wanted a second opinion on is often exactly the thing that differs.

One command

$ zgrok http 3000

The banner prints a public HTTPS URL. Send it. The other person opens the app running on your machine, at the commit you have checked out, with the data you are looking at.

Who else can open it

By default, anyone with the link. An assigned address is six random characters, which keeps the URL out of the way without protecting it: zgrok does not publish it, and because tunnel hostnames are served under a wildcard certificate, yours does not show up in a certificate transparency log the way a per-host certificate would. That is obscurity, not a control: six characters over a 36-letter alphabet is about two billion names, which is enumerable by anyone who wants to.

For most sharing that is fine, because the tunnel is up for twenty minutes while you are both looking at it, and the address stops answering when you press Ctrl+C. When it is not fine, put a password in front of it:

$ zgrok http 3000 --basic-auth demo:secret123

The public URL then answers 401 with a WWW-Authenticate challenge until someone supplies those credentials, which browsers know how to prompt for. The check happens at the tunnel server, so a visitor who cannot answer it never reaches your machine. Send the credentials by a different route than the link, for the same reason you would not put a key under the doormat you just photographed.

If you know where the other person is coming from, you can narrow it further:

$ zgrok http 3000 --allow-ip 203.0.113.50,198.51.100.0/24
Both of those are Pro features, and asking for either on a plan that does not have it refuses the tunnel rather than starting one without the protection you asked for. That is deliberate: a link you believe is password-protected is worse than one you know is open.
401A visitor without the credentials gets a 401 and a password prompt from the tunnel server. Nothing reaches your machine.

Watching what they did

Unless you turn it off, a tunnel runs a request inspector on your own machine and prints its address in the banner:

Inspect: http://127.0.0.1:4040

When the feedback is "it broke" and nothing else, that is where the answer is: the request they made, the status your app returned, the body it sent back. It keeps the last 50 requests in memory for the life of the tunnel and binds to loopback only, so what it captured does not leave your machine.

Worth saying on this page in particular: that includes anything the person you shared the link with typed into your app.

What this is not

It is not hosting.

The app runs on your machine, so it is available while your machine is awake and the command is running, and it stops when you stop. For a review that is the point. For anything that needs to be there tomorrow, deploy it.

The address

On Free the address is rewritten on your next run, so a link you sent yesterday will not open today. A tunnel name you choose inside your project survives restarts on Pro, if you are sharing the same URL repeatedly:
$ zgrok http 3000 --subdomain myapp

Next

Run your first tunnel.

Free to start. $9 for a URL that stays. You pay for features, never for traffic.