Tondavo

How it works

This page explains what runs where when you start npx tondavo, what Tondavo changes on the way between your phone and your dev server, and when to skip the edge with --lan. It is for a developer deciding whether to use Tondavo. For who can reach what and what is kept, see Security.

The three parts

The CLI on your computer

You run it in your project folder while your dev server is running:

npx tondavo          # looks for a dev server on common ports
npx tondavo 5173     # or name the port

Without a port, it checks 5173, 3000, 5174, 4321, 8080, 8000, 8888 and 4000 on localhost, in that order, and uses the first one that answers, or 5173 if none does. If several answer, it names the others so you can choose.

  • It starts a local bridge that listens only on your computer. The bridge passes the phone's requests to your dev server and passes the answers back, with the changes listed below.
  • It opens one outgoing connection to the edge at dev.tondavo.com. You don't open a port on your router, and nothing on your computer listens for the internet.
  • It prints a QR code that carries the pairing link.
  • It writes the phone's reports and screenshots to .tondavo/ in your project.
  • It gives you and your agent commands such as logs, screen and tap, and the same commands as MCP tools (MCP is the way Claude Code and other agents get new tools).

The script added to your pages

Every HTML page your phone loads through Tondavo gets one script tag. The script comes from the CLI, not from the internet, and connects back to the CLI through the same address as the page.

  • On its own, it reports JavaScript errors, unhandled promise rejections, scripts and images that fail to load, fetch requests that fail or take longer than 3.5 seconds, console output, taps, focus on form fields, scrolling, page changes, content wider than the screen, and camera and microphone permission results.
  • A three-finger tap on the phone lets you point at an element and write a note for your agent.
  • When the CLI asks, it runs JavaScript in the page, taps, types, swipes, reads the screen as text and takes screenshots.
  • It reloads the page when the CLI tells it to.

What the script reports, and what it leaves out, is listed in Security.

The edge at dev.tondavo.com

The edge is a server on Cloudflare. Your phone opens your app at https://dev.tondavo.com.

  • The address is HTTPS, so the page is a secure context: the browser state that turns on the camera, microphone, WebCrypto, service workers (the edge refuses service workers on dev.tondavo.com; see Security) and the clipboard API.
  • It pairs phones. Opening the link from the QR code pairs that browser with your session.
  • It passes a paired phone's requests down your CLI's connection to your computer, and the answers back.
  • It answers everyone else itself. A browser that isn't paired gets a page saying so, or a 403, and its requests never reach your computer.
  • The phone can be on any network, including mobile data. The phone and your computer don't need to share Wi-Fi.

Traffic is decrypted at the edge on the way through. Security says what that means and what the edge keeps.

One request, start to finish

  1. The phone's browser asks dev.tondavo.com for a page.
  2. The edge checks that this browser is paired with a running session. If it isn't, the edge answers and stops there.
  3. The edge sends the request down the open connection to your CLI.
  4. The CLI sends it to your dev server on localhost.
  5. The answer goes back the same way. HTML pages get the script tag on the way.

What Tondavo changes

Your files on disk never change. Tondavo changes requests and responses as they pass through.

In responses

  • HTML pages get one script tag, <script src="/__tondavo/sensor.js"></script>, right after the opening <head> tag. Without a <head>, it goes after the doctype, or at the very start.
  • HTML pages lose their Content-Security-Policy header. A CSP (a header that tells the browser which scripts may run) would block the added script. A policy set in a <meta> tag is not removed and can still block it. A Content-Security-Policy-Report-Only header is left as it is.
  • HTML, JavaScript and CSS are never cached. Their Cache-Control becomes no-store, no-cache, must-revalidate, and their ETag and Last-Modified headers are removed, so Safari doesn't show an old file after you change it.
  • Compressed HTML passes through untouched. Tondavo asks your server for uncompressed responses. If the server compresses HTML anyway, the page gets no script tag and keeps its CSP header.
  • Every response gets X-Robots-Tag: noindex, nofollow from the edge, so search engines don't index your app.

In requests

  • Host. Your server sees localhost:<port> as the host, so the host checks in Vite and Next.js pass without configuration. The public host is in X-Forwarded-Host.
  • Origin and Referer. When the page calls its own address, these show your app's localhost address, as they would behind a reverse proxy.
  • Compression and caching. Accept-Encoding becomes identity, and If-None-Match and If-Modified-Since are removed, so your server always sends the whole file.
  • Cookies. Your app's cookies pass through.
  • Other headers pass through as the phone's browser sent them, plus X-Forwarded-Proto: https and the headers Cloudflare adds, such as the phone's IP address.

Reserved paths

  • Paths starting with /__tondavo/ belong to Tondavo. Don't use that prefix in your app.
  • Requests for anything inside a .tondavo folder get a 404, so the phone can't read the folder where Tondavo keeps its logs and screenshots, even if your server serves the project folder.

Reload on save

The CLI watches the folder you started it in, including subfolders. When a file changes, it waits 150 ms for further changes, then reloads the page on every connected phone. The page keeps its scroll position if it reloads to the same path.

  • Ignored: folders whose name starts with a dot (.git, .next, .tondavo), node_modules, and files ending in .log, .swp or ~.
  • Watched: dist and build, so a build that writes there reloads the phone when it lands.
  • This is a full page reload. Your dev server's hot module replacement (HMR, which swaps changed code without a reload) also works through Tondavo, so a save can trigger both. To keep HMR alone, start with --no-watch.
  • Press r in the terminal to reload by hand. Agents have the reload tool.

Sessions

Restarting tondavo in the same folder keeps the session, so a paired phone reconnects without scanning; --new starts a fresh one. The limits are on Pricing, and how pairing is protected is on Security.

Skip the edge with --lan

npx tondavo --lan

With --lan, the edge isn't used at all. The bridge listens on your computer's network address, and the QR code points at http://<your Wi-Fi address>:8788, or another free port if 8788 is taken.

  • Same network. The phone must be on the same network as your computer. Guest and office Wi-Fi often stop devices from reaching each other.
  • Plain HTTP. The page isn't a secure context, so the camera, microphone, WebCrypto, the clipboard API, service workers and --capture screenshots don't work.
  • Unencrypted on Wi-Fi. The pairing link and all traffic cross your network in the clear.
  • No phone limit or pairing window. Any browser that opens the link while the CLI runs is let in, for 8 hours.

Use --lan when:

  • you don't want your app's traffic to pass through a third party,
  • you have no internet connection, or your network blocks dev.tondavo.com,
  • your app doesn't need the camera, microphone or other secure-context features, and
  • you trust everyone on the network.

Otherwise, use the default. To try it: npx tondavo, and see Getting started.