dev-code-proxy

Workflows

Webhooks & OAuth callbacks

Payment providers, Git hosts, chat platforms and sign-in providers need a URL on the internet that reaches your code. With dcp that URL points at your laptop, and it stays the same: register it once, and it works every day you run dcp.

https://bigfoot.tail1234.ts.net/api/webhooks/stripe

https://bigfoot.tail1234.ts.net
Your machine. Same name tomorrow, after a reboot, on another network.
/api/
The project folder of the dev server that should receive it.
webhooks/stripe
Your app's own route, unchanged.
Anyone with the link, or only your tailnetMade by dcp

The workflow

  1. Start the app that receives the call, as usual.
  2. Sharing is on by default (public: the provider is outside your Tailscale network). dcp ls prints each link, and dcp url api --tailscale just one.
  3. Paste https://<machine>.<tailnet>.ts.net/<project>/<your route> into the provider's settings. Once.
  4. Trigger the event. The request reaches your app with its body and headers untouched, so signature checks pass.

A Cloudflare link, https://<app>-<machine>.<zone>, is a stable public URL too, under your own domain and with no path prefix, and works with any of these services: dcp url api --cloudflare prints it.

The link stays up while the machine is on, after reboots too: the local HTTPS proxy keeps sharing. When the app is stopped, the provider gets an error and retries later, as it would with a deployed site that is down.

Examples

Dashboard: Developers, Webhooks, Add endpoint.

Endpoint URL   https://bigfoot.tail1234.ts.net/api/webhooks/stripe

Your handler verifies Stripe-Signature with the endpoint's signing secret, as in production. With the Stripe CLI you'd run stripe listen in every session and get a new secret each time; this endpoint and its secret stay.

When the provider can't reach it

What you seeWhyFix
Timeout, connection refusedsharing is off, tailnet-only (Serve), or not onlinedcp status names the fix; dcp tailscale on --public (Stripe or GitHub is never on your tailnet), or a Cloudflare link (When a link does not open)
404 from dcpno dev server for that project is runningstart it; dcp ls shows the project names
502the app is starting, or crashedcheck the app's own logs
OAuth: redirect URI mismatchthe app built a localhost redirectdcp --forward-host
The URL changedthe machine was renamed in Tailscale (both links carry its name)rename it back in the admin console, or update the provider
Not sure it answers from outsidea new link, or a changed settingdcp check: DNS, certificate and status of every link

More in Troubleshooting.