Skip to content
--qr

Your site, on a real phone.

A simulator tells you what your layout does. It does not tell you what a real phone does, on a real network, with a real browser and a real keyboard. For that the phone has to reach the server on your machine, and localhost:3000 typed into the phone means the phone's own port 3000.

~/app · A phone loading your dev server
$ zgrok http 5173 --qr
✓ Online · web--acme-shop.zgrok.io → localhost:5173
GET/20024 ms
GET/assets/index.js2009 ms
GET/@vite/client101live
GET/api/products20048 ms
On this page

The LAN address answer, and where it stops

The usual next step is to bind the dev server to all interfaces and open your machine's address on the phone, something like http://192.168.1.14:3000. It is free and it often works, so it is worth saying exactly where it stops rather than dismissing it.

The same network

It needs both devices on the same network, which rules out testing on cellular, and rules out the guest and corporate networks that isolate clients from each other.

Typing the address

It needs you to read an address off one screen and type it into another.

Plain HTTP

It is plain HTTP.

That last one is the one that bites, because it is not a matter of taste. Browsers restrict a set of capabilities to what the specification calls a secure context, and treat localhost as one while a plain-HTTP LAN address is not. On the phone that means the features most worth testing on a phone are the ones that will not run: geolocation, camera and microphone, and service workers. Chrome documents HTTPS among its installability criteria too, so the install prompt goes with them. And an HTTPS page cannot fetch an HTTP LAN address at all, because that is mixed content.

The LAN address gets your layout onto the device and leaves the mobile-specific half of your app untested.

One command, and something to scan

$ zgrok http 3000 --qr

The banner prints the public URL and, under it, a QR code drawn with Unicode half-block characters so it stays square in a terminal. Point the phone's camera at it and open the link. Nothing gets typed, and the phone does not have to be on your network at all, because it is reaching a public address rather than yours.

The URL is HTTPS with a real certificate, so the phone is in a secure context and the capabilities above are available to test. That is the whole difference between this and the LAN address, and it is why the answer is a tunnel rather than a better way to type an IP.

QR code for https://www.zgrok.io
zgrok http 5173 --qrThe code prints right in the terminal. This one is real and opens zgrok.io, so you can try the gesture now.

Devtools you do not have on the phone

The hard part of phone testing is not reaching the site, it is seeing what happened after you tap. Remote debugging works and costs you a cable, a setting and a desktop browser that agrees to talk to that phone.

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

Inspect: http://127.0.0.1:4040
50 requests

The network tab you could not open

Open it on your laptop while you tap on the phone. Requests the phone makes land there with their headers, their body and the status your app returned, which is the network tab you could not open. A record appears when the request finishes, so a long streaming response is not visible while it is still streaming. It holds the last 50 requests in memory for the life of the tunnel and captures bodies up to 128 KB in each direction. It binds to loopback only, so what it captured stays on your machine.
Replay

Without picking the phone back up

Replay is there too, and on a phone it earns its place: a request that only happens after six taps and a scan can be re-run against your handler from the laptop as many times as you need, without picking the phone back up. A request whose body ran past the capture limit is refused for replay, and says so.

One thing your framework may object to

The Host header is passed through unchanged, so your dev server sees the tunnel hostname rather than localhost.

Several dev servers check that header against an allowlist and refuse anything they do not recognise, so a tunneled request can be turned away before it reaches your app. Vite is the one most people meet, and it answers 403 Blocked request naming the host and the config key to add.

How long the address lasts

On Free the assigned address belongs to that run: stop the tunnel and start it again tomorrow and the name is rewritten, so yesterday's QR code no longer points at your machine. For a testing session that is usually fine, because you scan it at the start.

If you want the same address on the phone every day, or you are handing the link to a tester who will come back to it, a tunnel name you choose inside your project on Pro survives restarts:

$ zgrok http 3000 --qr --subdomain myapp

Next

Run your first tunnel.

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