dev-code-proxy

Reference

Troubleshooting

One command checks everything and prints the fix for each problem it finds:

dcp doctor     # Tailscale, Funnel, discovery and each sharing provider; the boot service, the proxy and the trusted CA
dcp status      # each provider online, or the problem, its fix and a help link

Find your symptom below; the rest of the page has the details.

Local HTTPS names (*.localhost)

SymptomFix
dcp run warns "the local HTTPS proxy is not running"dcp service install (it prints the proxy's log when it cannot start)
Browser: "not private"; curl: certificate errordcp trust (macOS: at the screen, not over SSH), then restart the browser
https://<name>.localhost can't be reached (no answer, a TLS error)nothing serves that name: start the app, or check its name with dcp ls; a server gets its folder's name unless its config says otherwise (Pick the name). dcp configure --catch-all makes such names show a page listing what runs
https://<name>.localhost answers 404 "nothing runs at"the catch-all is on and nothing serves that name: the page lists what does run
A server runs but has no nameit listens outside the port range (dcp configure --ports …), its runtime isn't a web one (--all), discovery is off, or its config was skipped: dcp ls and https://dcp.localhost say which file and how to fix it
It answers 502 "not answering"the app is still starting, stopped, or (with dcp run) doesn't listen on $PORT and $HOST; the page shows the port, process and folder
http://<name>.localhost doesn't redirectanother program holds port 80 (dcp doctor names it), or the boot service predates the redirect: dcp service install once
"already runs (pid …)"stop the other terminal's run, or dcp run --force
A port is taken by a server you forgotdcp stop <port> (or the Stop button on https://dcp.localhost); --force when it ignores the stop
Something was slow or failed earlierdcp stats (per name, p50/p95/p99) and dcp logs (Logs and stats)
Every *.localhost hangsanother program holds port 443: lsof -nP -iTCP:443 -sTCP:LISTEN (Funnel next to the proxy)
SymptomFix
A provider is not onlinedcp status prints the problem and its fix: When a link does not open
A link does not open from outsidedcp check: DNS, certificate and answer of every link, and the step that failed
dcp ls shows no online linksNo services found
A webhook or callback never arrivesit needs a public link (Funnel or Cloudflare), not tailnet-only: Webhooks
The page loads without stylesopen it through its /<project>/ link: A page loads without styles
Opens on the phone, not on this MacMagicDNS
A container can't resolve the ts.net nameReaching services from a container
502 upstream error502: the dev server stopped; it clears on the next scan
The link stays up after kill -9Funnel still on after a hard kill

Works from my phone but not my Mac (MagicDNS)

From the host, MagicDNS resolves <node>.ts.net to your tailnet IP, so the request may be answered locally instead of traversing the public Funnel.

  • Test from outside your tailnet — a phone on cellular, or another network.
  • Force the public ingress from the host:
    PUBIP=$(dig +short <node>.ts.net @1.1.1.1 | head -1)
    curl -s -i --resolve "<node>.ts.net:443:$PUBIP" "https://<node>.ts.net/<slug>/"

A page loads without styles

Fixed by cookie route-affinity: visiting …/<slug>/ sets a dcp_route cookie so that tab's prefix-less requests (/_next/..., /api/..., HMR) reach the right backend.

  • Make sure you opened it via its /<slug>/ URL (that's what sets the cookie).
  • Don't actively use two different apps in the same browser at once — affinity is per-browser. Use separate browser profiles, or re-visit the /<slug>/ URL.

Reaching services from a container ("Failed to resolve …ts.net")

This error means the container's DNS can't resolve the name. The fix depends on where the container runs and which mode you used — *.ts.net resolves two different ways:

  • Funnel (public, default) — the name is in public DNS; any host resolves it.
  • Serve (dcp tailscale on --tailnet) — the name only resolves via MagicDNS inside your tailnet, pointing at a 100.x address only tailnet members can route.

Container on the same machine as dcp (Docker Desktop)

Skip DNS — talk to the proxy directly by path. Bind it to a reachable address:

dcp --bind 0.0.0.0
# inside the container — routes /<slug>/ to your local dev server:
curl http://host.docker.internal:18443/<slug>/        # Docker Desktop
# Linux: docker run --add-host=host.docker.internal:host-gateway ...

container → host dcp → 127.0.0.1:<service>, no DNS or tailnet involved.

0.0.0.0 exposes the proxy to your LAN — bind a specific interface (e.g. the docker bridge --bind 172.17.0.1) to narrow it. host.docker.internal only points at the same host, so this does not work for a remote pod.

Container on a remote host / Kubernetes (the usual cause)

A remote pod can't reach host.docker.internal, so use the exposure URL — but how you make it resolve depends on the mode.

Funnel (public, default): the name is in public DNS, so a pod with working internet DNS should already resolve it. If the pod's resolver is locked down, pin the name to the public Funnel ingress IP (hostAliases is the k8s --add-host):

dig +short your-node.ts.net @1.1.1.1     # → public ingress IP, e.g. 209.177.145.192
# Kubernetes pod spec
spec:
  hostAliases:
    - ip: "209.177.145.192"
      hostnames: ["your-node.ts.net"]
# plain Docker on a remote host
docker run --add-host "your-node.ts.net:209.177.145.192" ...

When the remote host is itself on the tailnet (MagicDNS shadows the name)

The subtle case. If the consuming host runs Tailscale with MagicDNS enabled (the default, --accept-dns=true), Tailscale's resolver 100.100.100.100 answers *.ts.net with the node's tailnet 100.x address — not the public Funnel ingress. Traffic then crosses the tailnet to your node's tailscaled, which only serves that path if you set up Serve; a Funnel-only node won't answer. Containers on that host fall back to public DNS, which may still be negatively cached as NXDOMAIN:

nslookup your-node.ts.net 8.8.8.8           # NXDOMAIN (not cached yet)
nslookup your-node.ts.net 100.100.100.100   # resolves via MagicDNS

dcp doctor prints an advisory magicdns note whenever the node has accept-dns on, as a reminder of this gotcha.

The Funnel name is in public DNS, so stop MagicDNS from shadowing it on the consuming host (the remote one — not the machine running dcp):

tailscale set --accept-dns=false      # use public DNS for *.ts.net; re-enable with =true
dig +short your-node.ts.net @8.8.8.8  # now confirms → 209.177.145.192

Prefer dcp to do it on start (opt-in, off by default)? Pass dcp --accept-dns=false. It persists after exit — revert with tailscale set --accept-dns=true.

Don't want to change the host's DNS? Fix only the container — point it at MagicDNS, or pin the public IP:

docker run --dns 100.100.100.100 ...                          # resolve like the host
docker run --add-host your-node.ts.net:209.177.145.192 ...    # or skip DNS entirely

Why dcp doesn't set --accept-dns=false for you: it's a global, persistent, machine-wide Tailscale setting that disables MagicDNS for every *.ts.net name (breaking resolution for your other tailnet nodes), and it belongs on the consumer host — usually a different machine from the one running dcp. A dev proxy silently changing your system DNS would be surprising and out of scope, so it's a deliberate, reversible step you run yourself.

Serve (--tailnet): the name and its 100.x address only work from inside the tailnet — there's no public IP to point at. The remote pod must join the tailnet: run a Tailscale sidecar (or the Tailscale Kubernetes operator). Once it's on the tailnet, MagicDNS resolves the name and 100.x routes normally. If the pod can already route 100.x, map the name to the tailnet IP instead (tailscale ip -4):

docker run --add-host "your-node.ts.net:100.x.y.z" ...

Rule of thumb: remote container that stays off the tailnet → use Funnel and resolve the public name. Remote container you can put on the tailnet → use Serve with a Tailscale sidecar and let MagicDNS do its job.

No services found

dcp only registers known web runtimes within the port range by default.

dcp --ports 3000-9000          # widen the range (single port: --ports 4000)
dcp --runtimes node,bun,python # add runtimes
dcp --all                      # every listener, incl. unrecognized binaries

The same project shows on multiple ports / a slug has a -<port> suffix

Expected. Within one project folder, dcp keeps the process on the lowest port as the "main" service (clean slug) and gives any other process in the same folder a -<port> suffix so it stays reachable — e.g. bun dev on :3087 → myapp/, an aux tool on :4983 → myapp-4983/. A single process on several ports is collapsed to its lowest port. Two distinct projects sharing a folder name also get a -<port> suffix. Run dcp ls for the canonical slugs.

lsof not found (macOS/Linux)

Install it: apt install lsof / dnf install lsof. macOS ships it.

Funnel still on after a hard kill

A terminal dcp start resets on Ctrl-C. After kill -9, clear it manually:

tailscale funnel reset   # or: tailscale serve reset (for Serve)
tailscale serve status   # should print "No serve config"

The local HTTPS proxy's share is meant to stay on; dcp tailscale off removes its entry.

502 upstream error

The registered dev server isn't accepting connections (crashed or exited between scans). The body names the failed 127.0.0.1:<port>; it clears on the next scan once the server is back.

dcp start --bg runs detached and logs to ./dcp.log. Stop it by kill-ing the printed pid, then tailscale serve status to be sure the entry is down.

Funnel on 443 next to dcp proxy (macOS)

Tailscale.app's Serve/Funnel on 443 listens on every address (*:443); dcp proxy listens on 127.0.0.1:443 and [::1]:443. macOS hands local connections to the more specific listener, so both run side by side in either start order (dcp proxy binds as root, before it drops to your user): https://*.localhost goes to dcp proxy, the public https://<node>.ts.net/<project>/ to the Funnel.

Another local HTTPS proxy that listens on *:443 itself cannot share the port. If every https://*.localhost hangs while dcp runs, lsof -nP -iTCP:443 -sTCP:LISTEN shows who holds it; move the Funnel off 443 with:

dcp tailscale on --https-port 8443    # dcp's entry moves to 8443

The local proxy port (port, default 18443) must never be the public port: dcp refuses a port equal to httpsPort.