---
title: "Send a Mac download link that expires in 3 days"
description: "Serve the file from a localhost-only web server, then put a TSLink guest link with a 3-day deadline in front of it. The recipient needs only a browser, and you can revoke the link early."
url: "https://tslink.md/docs/expiring-download-link"
locale: "en"
product_version: "0.4.0"
source: "https://github.com/anydoor7/tslink/blob/v0.4.0/docs/guest-links.md"
---

> Documentation index: https://tslink.md/llms.txt · Installed binary is authoritative: `tslink manifest`.

**Serve the file from a small web server that listens only on your Mac, register that server with TSLink, and create a guest link with `--for 3d`. The recipient opens the link in a browser with no Tailscale account. After three days, or as soon as you revoke it, the same link shows an unavailable page (HTTP 401) and your file server is no longer contacted.** With Python's built-in server, in one terminal:

```bash
mkdir -p ~/handoff && cp ~/Desktop/report.pdf ~/handoff/
python3 -m http.server 8000 --bind 127.0.0.1 --directory ~/handoff
```

Then in a second terminal:

```bash
tslink add handoff --proxy localhost:8000
tslink guest create handoff --for 3d --label "Report for Acme" --public --print-link
```

This needs TSLink v0.4.0 or later. The last command prints the link once. Send it to the recipient; there is nothing for them to install. TSLink is an independent project, not made by Tailscale.

## Before you start

* **TSLink installed.** See [installation](https://tslink.md/docs/installation.md). On a Mac without the Xcode Command Line Tools, the first `python3` may offer to install them.
* **A Tailscale account with MagicDNS and HTTPS turned on.** TSLink embeds Tailscale, so the Mac does not need the Tailscale app.
* **Funnel permission.** Guest links reach the internet through [Tailscale Funnel](https://tailscale.com/docs/features/tailscale-funnel), which needs a `funnel` node attribute in your tailnet policy file. For an explicitly public service TSLink provisions that policy by default when it has usable API access and policy permissions; otherwise add the attribute yourself as Tailscale's Funnel page describes.
* **A Mac that stays awake and online for the whole period.** The file is served from your disk, so the link works only while the Mac, the Python server and TSLink are running.
* **A neutral app name.** HTTPS names appear in public certificate logs, so `handoff` is a better name than the client's name.

## What each step does

1. **Copy only the file into its own folder.** Python's server lists the folder at `/` and serves everything in it, so never point it at your home folder. `--bind 127.0.0.1` keeps other devices on your Wi-Fi from reaching it directly; by default it [binds to all interfaces](https://docs.python.org/3/library/http.server.html).
2. **Register a private app.** `tslink add handoff --proxy localhost:8000` registers the server as a private HTTP proxy app and starts the background service if needed. On a first run it may return `needs_login` with an `auth_url`: open it once in a browser to enroll the node before the next step, or `guest create` stops with `enrollment_required`. A new installation also gives the app a route on the [home gateway](https://tslink.md/docs/portal-gateway.md); you do not need to remove it yourself.
3. **Decide on a PIN, then create the link.** A PIN can only be set when the link is created. If the link might travel, add `--pin` to `guest create`, type a 6 to 64 digit PIN at the hidden prompt, and send the PIN through a different channel; never put it in a command argument. `--for` is required: the minimum is 1h and the default maximum is 7d ([durations](https://tslink.md/docs/durations.md)). `--public` acknowledges that the app becomes reachable from the internet through Funnel behind a mandatory guest gate. `--print-link` reveals the link once; TSLink stores only a salted hash of its token, so a lost link cannot be shown again. The first link takes the app off the home gateway in the same step and says so (`removed_gateway_route`). `guest create` waits up to 8 seconds for the app's address; if it still reports `url_not_ready`, nothing was saved: run `tslink url handoff --wait=30s` and run the same command again. If someone else uses the gateway route, for example a person you granted the app to, it refuses with `portal_route_guest_refused`, changes nothing and names the next command.
4. **Check that it is live before sending.** `guest create` saves configuration and the background service applies it. Run `tslink status` and `tslink doctor`; `doctor` warns when it cannot verify active Funnel for a gated app. The first time an app name goes public, Tailscale says public DNS records [can take up to 10 minutes](https://tailscale.com/docs/features/tailscale-funnel) to appear. To try the link yourself, use a device outside your tailnet, such as a phone on mobile data with Tailscale switched off: inside the tailnet, a guest link only redirects to `/` without creating a guest session.

## What the recipient sees

The link opens `/guest/<token>` on your app's `*.ts.net` address. TSLink sets a session cookie and redirects to `/`, where Python's directory listing shows `report.pdf`. With a PIN, a short form asks for it first. An expired, revoked or mistyped link shows the same unavailable page, which names no app and asks the visitor to reopen the original link or contact its sender.

## Check, revoke and clean up

```bash
tslink guest list
tslink access log --app handoff --since 24h
tslink guest revoke <id>
tslink remove handoff
```

`guest list` shows each link's ID, expiry and use count. Revoking is permanent for that ID and also cancels requests in progress and closes their connections. `tslink remove` revokes every link the app still has, so an app added later under the same name cannot bring them back. When you are done, stop the Python server with Ctrl-C. Use counts are local estimates, and [access history](https://tslink.md/docs/access-history.md) is bounded and can have gaps.

### Need a new link or a PIN

Run `guest create` again: each link has its own ID, deadline and optional PIN, and a second link works while the first is still active. A PIN can only be set when its link is created, so add `--pin` to the new command and revoke the old link with `tslink guest revoke <id>` if it should stop working. Do not retry a failed `guest create` without `--print-link`: it succeeds but saves a link nobody can retrieve, so revoke any such grant.

In v0.3.1 and earlier, `guest create` did not remove the gateway route (run `tslink portal route remove <app>` first), and a second `guest create --print-link` for the same app failed with `url_not_ready` while its guest gate was active. Upgrade instead of working around it.

## Limits to know

* **Guest links only work for HTTP proxy apps.** Folders and files you register with `tslink add --dir` or `tslink share <path>` stay private to your tailnet, which is why you run a local web server yourself. TSLink does not serve the file to guests.
* **The link is a public, forwardable bearer link.** Anyone who has it, plus the PIN if you set one, can download until the deadline. A label is your own note and does not identify who visited.
* **Expiry cannot recall a download.** Revocation and the deadline stop new requests and close downloads in progress; a request authorized just before a revocation may still finish, and a file already saved stays with the recipient.
* **Seven days is the default ceiling.** The owner can raise it with `durations.public_max` in `config.json`, for example `14d`. `never` is refused for guest links.
* **Funnel has bandwidth limits.** Tailscale says traffic over Funnel is subject to non-configurable bandwidth limits. We have not measured downloads through a guest link, so try a large file yourself before relying on it. For very large files, a transfer service or [private access as a named person](https://tslink.md/docs/people-sharing.md) may suit better; while the guest gate is up an app cannot take new people grants, so use a separate app name, and for someone outside your tailnet a stored Tailscale API token.

## When something else is the better choice

| Option                                                                                                                                                | Choose it when                                                                                                                                                         | What you give up                                                                                                                                                                                                      |
| ----------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [Tailscale Serve](https://tailscale.com/docs/reference/tailscale-cli/serve)                                                                           | The recipient is already in your tailnet, or it is your own device. Nothing becomes public.                                                                            | The recipient needs Tailscale; Serve has no deadline.                                                                                                                                                                 |
| [Tailscale Funnel](https://tailscale.com/docs/reference/tailscale-cli/funnel) on its own                                                              | A public link with no deadline is fine.                                                                                                                                | Its CLI flags include no expiry or visitor check, so you stop it yourself.                                                                                                                                            |
| [Cloudflare Quick Tunnel](https://developers.cloudflare.com/cloudflare-one/networks/connectors/cloudflare-tunnel/do-more-with-tunnels/trycloudflare/) | You want a link today with no Tailscale account. `--allowed-mail` admits only the listed email addresses, each verified with a one-time PIN in an interactive browser. | Access ends for everyone when `cloudflared` stops, the hostname changes every run, the email check does not work for non-interactive clients such as `curl`, and Cloudflare positions it for testing and development. |
| A named Cloudflare Tunnel or hosting                                                                                                                  | You want a permanent public site with no expiry.                                                                                                                       | You manage the account, the domain and any access policy.                                                                                                                                                             |
| A hosted share link (Dropbox, Google Drive and similar)                                                                                               | Recipient convenience matters most, or your Mac cannot stay online for three days.                                                                                     | The file is uploaded to the provider's storage.                                                                                                                                                                       |

If you were about to write your own token and deadline server, [why expiry is hard with http.server and a tunnel](https://tslink.md/docs/http-server-tunnel-expiry.md) lists what that takes.

## Let your coding agent do it

Paste this into Claude Code, Codex or Cursor and change the file path and recipient:

```text
Share ~/Desktop/report.pdf with one outside person as a download link that expires in 3 days, using TSLink guest links. Follow these rules:
1. Copy only that file into a new folder ~/handoff. Serve it with a local HTTP server bound to 127.0.0.1 only, for example: python3 -m http.server 8000 --bind 127.0.0.1 --directory ~/handoff. Keep it running in the background.
2. Check that tslink --version reports v0.4.0 or later. Register it as a private TSLink app: tslink add handoff --proxy localhost:8000. If the result says needs_login, show me the auth_url and wait until I have opened it. Do not remove the gateway route yourself; the first guest link does that.
3. Before creating anything, ask me whether I want a PIN; it can only be set now. Show me the guest command and wait for my yes before making anything public. If I want a PIN, ask me to run the command with --pin myself and type it at the hidden prompt; never put a PIN in a command argument. Otherwise run: tslink guest create handoff --for 3d --label "<recipient>" --public --print-link --json. Never use a lifetime above 7d and never use never.
4. Run tslink status and tslink doctor and confirm Funnel is active; a new public name can take up to 10 minutes to resolve. Then give me the link, the grant id, the expiry time and the exact revoke command: tslink guest revoke <id>.
5. Do not write your own token or expiry server, and do not start another tunnel. For a new link, run guest create again and revoke the old link if I ask. If guest create fails with url_not_ready, run tslink url handoff --wait=30s and try once more; never retry without --print-link.
6. When I say we are done: run tslink guest revoke <id> first, then stop the HTTP server and run tslink remove handoff.
```

Agents connected to the [TSLink MCP server](https://tslink.md/docs/mcp-server.md) can call `guest_create` with `public: true` and `print_link: true` instead; guest tools need the owner role.

## Related pages

* [Guest links](https://tslink.md/docs/guest-links.md): the gate, PINs, cookies and revocation in detail.
* [Let someone upload big files to my Mac](https://tslink.md/docs/upload-big-files-to-mac.md): the same pattern in the other direction.
* [Share one HTML report privately, with an end date](https://tslink.md/docs/private-html-report.md): when the recipient can use Tailscale.
* [Comparisons](https://tslink.md/docs/comparisons.md): TSLink next to Serve, Funnel, Cloudflare and others.

Official Tailscale, Cloudflare and Python sources linked above: accessed **2026-11-11**. TSLink behavior checked against **v0.4.0**; the throughput figure comes from one test with a TSLink build from main shortly after v0.3.1. TSLink is an independent project by [anydoor7](https://github.com/anydoor7/tslink), **not made or endorsed by Tailscale**.
