LAN Mode: Hand Your App to a Phone in Three Seconds

LAN Mode: Hand Your App to a Phone in Three Seconds

Tako-kun ·

You’re building a responsive layout. You want to see how it looks on your actual phone, not Chrome’s device emulator. The usual options are all bad: type your laptop’s IP and a port number into your phone’s browser, fight with self-signed cert warnings, or fire up an ngrok tunnel that broadcasts your half-built app to the public internet just so it can come back to a device three feet away.

There’s a better way. Press l in tako dev.

What happens when you press l

Tako detects your LAN IP, binds the dev proxy to 0.0.0.0:443, and publishes an mDNS record for every registered .test route as a matching .local hostname. Your phone — already a fluent mDNS client thanks to Bonjour — resolves myapp.local and connects over real HTTPS.

It also prints a QR code in your terminal pointing at http://<lan-ip>/ca.pem. Scan it on your phone, install the Tako development CA as a configuration profile, and the green padlock shows up on every .local hostname you serve, forever. One setup, every project.

$ tako dev
 dev daemon running
 routes ready

  https://myapp.test/

  l LAN mode · r restart · b background · ctrl+c stop

# press l

 LAN mode enabled

  https://myapp.local/ reachable from any device on your Wi-Fi

  ▄▄▄▄▄▄▄ ▄▄ ▄▄▄▄▄▄▄
 ███ █▀▀█▄ ███     scan to trust the dev CA
  █▄▄▄▄▄█ ▄▀█ █▄▄▄▄▄█     http://192.168.1.42/ca.pem

Press l again to turn it off. mDNS records vanish, the proxy goes back to loopback-only, and your laptop is no longer announcing anything to the network.

Why not ngrok?

Ngrok and similar tunnels solve a different problem — making your laptop reachable from the public internet. For real-device testing on the same Wi-Fi network, that’s the wrong tool. You don’t need a public URL, a third-party relay, or a rotating subdomain that breaks every OAuth callback you configure. You need your phone, three feet away, to talk to your laptop directly.

ApproachSetupURL on the phoneHTTPSPublic exposure
IP + portFind IP, type it, allow firewallhttp://192.168.1.42:3000NoLAN only
ngrok / CloudflareAccount, daemon, auth tokenhttps://abcd.ngrok.appYesPublic internet
mkcert + manual DNSEdit /etc/hosts on every devicehttps://myapp.testIf you trust the CALAN only
Tako LAN modePress lhttps://myapp.localYes (one-tap CA)LAN only

How it works under the hood

Diagram

When you toggle LAN mode, the dev server spawns one mDNS publisher per registered route — dns-sd on macOS, avahi-publish-address on Linux. Each publisher advertises one concrete hostname. The dev proxy starts listening on 0.0.0.0:443 and routes by Host header, the same way the production Tako proxy does.

One footnote: mDNS only knows how to advertise concrete records, so wildcard routes like *.app.test don’t translate. Tako warns you about this and suggests adding an explicit subdomain. Everything else — subpaths, multiple apps, multiple terminals — just works.

Try it

If you’ve got tako installed, you already have LAN mode. Run tako dev in any project, press l, scan the QR code on your phone, and open https://<your-app>.local in mobile Safari. Your responsive breakpoints, your touch targets, your iOS-only Safari quirks — all live, all over real HTTPS, all in about three seconds.

New here? brew install takoserver/tap/tako and check out the development docs or the CLI reference for everything tako dev can do beyond this one keystroke.