项目 / tailscale/tailcat

tailscale/tailcat

暂无行业标签
语言 Go标签 —数据更新 2026-11-25 06:49:28 · 仓库 2026-11-24

一段话介绍

像 netcat 一样好用,但走 Tailscale 数据面、不依赖其控制面。

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
like netcat, but over Tailscale's data plane, without Tailscale's control plane
9,416累计星
429Fork
+324峰值日增
2上榜次数

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景 — 暂未挂到行业场景库

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
tailcat 通过临时地址建立双向连接:服务端运行 tailcat 后客户端即可收发数据,还支持 serve/forward 将端口映射或代理到本地或其他主机端口。
星标走势近 25 天
本站点评(非项目 README 原文)
当开发底座/SDK 评估 tailcat(像 netcat 一样好用,但走 Tailscale 数据面、不依赖其控制面。):先写一个最小接入示例,确认 API 稳定再铺开。
首次发现 2026-09-06 · 最近在榜 2026-11-14 · 语言 Go · 贡献者 bradfitz、danderson、andrew-d、raggi、jwhited
go

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,正文较长,已截断:保留前 20000 字符(原始 35,008 字节),完整内容见 GitHub 仓库。

<p align="center">
  <img src="tailcat.png" alt="Tailcat" width="149" height="176">
</p>

<p align="center"><em>"Tailscale without Tailscale, by Tailscale"</em></p>

<p align="center">
  <a href="https://pkg.go.dev/github.com/tailscale/tailcat"><img src="https://pkg.go.dev/badge/github.com/tailscale/tailcat.svg" alt="Go Reference"></a>
  <a href="https://bsky.app/profile/tailcat.dev"><img src="https://img.shields.io/badge/Bluesky-@tailcat.dev-0285FF?logo=bluesky&logoColor=white" alt="Follow @tailcat.dev on Bluesky"></a>
</p>

# Tailcat

Tailcat is a remix of Tailscale open source pieces to act like
[netcat](https://en.wikipedia.org/wiki/Netcat), but over Tailscale's data plane,
without Tailscale's control plane. Tailscale's data plane (`magicsock`,
internally) gives you point-to-point WireGuard®-encrypted tunnels between two
machines with DERP as the NAT-hole-punching communication side channel and the
ultimate relay-of-last-resort if NAT traversal fails. Instead of using the
Tailscale control plane, all `tailcat` connection metadata is exchanged out of
band, however you want.

The `tailcat` CLI (in `cmd/tailcat`) is built on the `tailcat` Go library
(importable as [`github.com/tailscale/tailcat`](https://pkg.go.dev/github.com/tailscale/tailcat)).

Whether you use `tailcat` as a CLI tool or library, one side runs a `tailcat`
server (listener) and gets back a short tailcat address. The other side passes
that tailcat address to `tailcat`'s client side to connect. All traffic between
the two is
encrypted end-to-end with WireGuard. The initial connection bootstraps through
a DERP server ([see below](#bring-your-own-derp-relay)), and then magicsock performs NAT traversal to
upgrade to a direct peer-to-peer UDP connection when possible (usually!).

You don't need a Tailscale account, root/admin access on the machine
(it doesn't alter your machine's routing tables, DNS, etc.). It's just
a userspace library and CLI tool.

And it's all open source.

You can use our free rate-limited DERP relays (the default DERP map is
https://tailcat.dev/derpmap.json) or you can [run your own](https://github.com/tailscale/tailscale/tree/main/cmd/derper#derp).

There's also an experimental in-browser web demo (tailcat compiled to
WebAssembly) at https://tailscale.github.io/tailcat/ that can send and
receive files or text, interoperating with the CLI. Browser traffic is
relayed over DERP only, with no direct connections until WebRTC
support ([#4](https://github.com/tailscale/tailcat/issues/4)).

## Install

See [INSTALL.md](./INSTALL.md) for details on each, including notes
for packagers building from source:

| Method | Linux | macOS | Windows | FreeBSD,<br>OpenBSD | Browser<br>(js/wasm) |
|--------|:-----:|:-----:|:-------:|:-------------------:|:--------------------:|
| [Static binaries](INSTALL.md#prebuilt-binaries) | ✅ | | ✅ | | |
| [.deb packages](INSTALL.md#prebuilt-binaries) | Debian, Ubuntu, ... | | | | |
| [.rpm packages](INSTALL.md#prebuilt-binaries) | Red Hat, Fedora, ... | | | | |
| [Homebrew](INSTALL.md#homebrew-macos) | | ✅ | | | |
| [Scoop](INSTALL.md#scoop-windows) | | | ✅ | | |
| [Snap](INSTALL.md#snap-linux) | ✅ | | | | |
| [Container image](INSTALL.md#container-image) | ✅ | | | | |
| [Nix](INSTALL.md#nix) | ✅ | ✅ | | | |
| [AUR](INSTALL.md#arch-linux-aur) | Arch | | | | |
| [conda-forge](INSTALL.md#conda-forge) | ✅ | ✅ | ✅ | | |
| [Build from source](INSTALL.md#go-toolchain) | ✅ | ✅ | ✅ | ✅ | ✅ |

## Usage

### Pipe stdin/stdout between two machines

Server starts, printing out its ephemeral address:
```sh
$ tailcat
# Selected bootstrap relay region 302, San Francisco
# 🐈 Server listening with new address: tcomFwWCCcjS5nKNqAod034nWoJZW0LZqDhhC8U_dKdnDRYQ8uNGFpGQEu
(hangs, waiting...)
```

And then the client can:

```sh
$ echo hello | tailcat tcomFwWCCcjS5nKNqAod034nWoJZW0LZqDhhC8U_dKdnDRYQ8uNGFpGQEu
$ 
```

Then the server unblocks:

```sh
$ tailcat
# Selected bootstrap relay region 302, San Francisco
# 🐈 Server listening with new address: tcomFwWCCcjS5nKNqAod034nWoJZW0LZqDhhC8U_dKdnDRYQ8uNGFpGQEu
hello
$
```

### Expose local ports through the tunnel

Or you can serve a local TCP port, forwarded to localhost:

```sh
$ tailcat serve 8080,8443 # or: tailcat serve all
# 🐈 Server listening with new address: tcXXXXXXXXX
```

And then the client:

```sh
$ tailcat tcXXXXXXXXX 8080
GET / HTTP/1.1
Host: foo

HTTP/1.1 200 OK
....
```

A port mapping proxies a port somewhere other than the same port on localhost: to a different local port, or to a host and port elsewhere on the server's network. This serves port 5555 by proxying it to an Android device's adb port on the LAN, without exposing the rest of the network the way `exit-node` would:

```sh
$ tailcat serve 5555:10.2.200.213:5555
# Proxying port 5555 to 10.2.200.213:5555
# 🐈 Server listening with new address: tcXXXXXXXXX
```

Then on the client, `tailcat forward tcXXXXXXXXX 5555` followed by `adb connect 127.0.0.1:5555`. Write IPv6 targets in brackets: `5555:[fd7a::1]:5555`.

### Expose a local Unix-domain socket

A serve argument starting with `/` (or `unix:`, which also allows a
relative path) proxies connections to a local Unix-domain stream
socket. Without a port, the socket gets every port not otherwise
served, so a client needs no port number:

```sh
$ tailcat serve /run/git-annex/socket
# Proxying all other ports to unix:/run/git-annex/socket
# 🐈 Server listening with new address: tcXXXXXXXXX
```

```sh
$ tailcat tcXXXXXXXXX
```

Each client connection gets its own connection to the socket. tailcat
doesn't create the socket or change its permissions, and refuses to
start if it doesn't exist. To serve several sockets, or a socket
alongside other services, give each one a port with a mapping:

```sh
$ tailcat serve 22,8022:/run/app.sock
```

### Show the address as a QR code

Pass `--qr` to `serve` to also print the tailcat address as a QR code,
for copying it off a screen you can't paste from, such as a remote
console. Scanning it with a phone camera gets you the address as text
to copy; nothing opens automatically.

```sh
$ tailcat serve --qr 8080
# 🐈 Server listening with new address: tcXXXXXXXXX
[QR code]
```

### Forward local ports to a tailcat server

To make ports served by a tailcat server available as ordinary local TCP ports (for browsers, database clients, or other tools that do not support SOCKS or stdio), run `forward` with the server's tailcat address:

```sh
$ tailcat serve 8080,3306
# 🐈 Server listening with new address: tcXXXXXXXXX

$ tailcat forward tcXXXXXXXXX 18080:8080 3306
```

A local port of 0 asks the operating system for a free port; each listener prints its address once it's listening.

To forward local ports to assets on the network reachable by an exit-node server, run the server in exit-node mode and specify each remote IP address and port in the mapping:

```sh
$ tailcat serve exit-node
# 🐈 Server listening with new address: tcXXXXXXXXX

$ tailcat forward tcXXXXXXXXX \
    3001:172.23.52.30:3001 \
    17170:172.23.52.31:17170
```

This forwards `127.0.0.1:3001` to `172.23.52.30:3001` and `127.0.0.1:17170` to `172.23.52.31:17170` through the exit-node server.

By default, listeners bind to `127.0.0.1` and diagnostic logs are suppressed. Pass `--verbose` before the subcommand to enable verbose networking logs. Use `--bind=0.0.0.0` only when clients on other machines should be able to connect:

```sh
$ tailcat forward --bind=0.0.0.0 tcXXXXXXXXX 18080:8080
```

Press Ctrl-C to stop forwarding.

### Open a browser to a tailcat server

To view a web server behind a tailcat server, run `browse`:

```sh
$ tailcat serve 80
# 🐈 Server listening with new address: tcXXXXXXXXX

$ tailcat browse tcXXXXXXXXX
```

This is an alias for `tailcat forward --open-browser <tc-addr> 0:80`: it opens `http://127.0.0.1:<port>/` in a web browser once the local listener is ready, then blocks, forwarding connections, until interrupted. The `--open-browser` flag works with any single `forward` port mapping.

### Public-key-authenticated SSH server

Run an SSH server that accepts keys from local `authorized_keys` files,
literal OpenSSH public key lines, or GitHub accounts:

```sh
$ tailcat serve --ssh-authorized-keys=~/.ssh/authorized_keys ssh
# 🐈 Server listening with new address: tcXXXXXXXXX
```

Multiple sources can be comma-separated. A `user@github` source fetches
`https://github.com/user.keys` once, before the server starts:

```sh
$ tailcat serve --ssh-authorized-keys=bradfitz@github,./contractor.pub ssh
```

Every source must exist, fetch successfully, and contain valid public key
lines or startup fails. Authorized-key options such as `command=` and
`from=` are rejected because the built-in server does not implement them.
Running `tailcat serve ssh` without `--ssh-authorized-keys` also fails; use the
explicit `no-auth-ssh` service when the tunnel identity alone is sufficient.

### Auth-free SSH server

On Linux, macOS, and Windows, you can also explicitly run the SSH server with
no client authentication. The encrypted tunnel provides the client identity.

```sh
$ tailcat serve no-auth-ssh
# 🐈 Server listening with new address: tcXXXXXXXXX
```

> [!WARNING]
> With `no-auth-ssh`, the address **is** the credential: anyone who
> learns it gets a shell as the user running the server. Share it only
> over private channels, and never publish it, in a DNS TXT record or
> anywhere else public. If you want an SSH server reachable by DNS
> name, it must require client authentication: `--allow` at the tunnel
> layer, `--ssh-authorized-keys` at the SSH layer, or both.

And on the client side:

```sh
$ tailcat ssh tcXXXXXXXXX
$ tailcat ssh tcXXXXXXXXX ls -la
```

### Run a command per connection

Like inetd, the `exec` service runs a command for each incoming
connection, with the connection as the command's stdin and stdout.
The command comes after `--`:

```sh
$ tailcat serve exec -- /usr/bin/fortune
# 🐈 Server listening with new address: tcXXXXXXXXX
```

```sh
$ tailcat tcXXXXXXXXX 80 < /dev/null
```

The command's stderr goes to the server's. It gets the peer's node
key in `$TAILCAT_PEER_KEY` (in `--allow`'s format) and the peer's
tailcat IP:port in `$TAILCAT_REMOTE_ADDR`.

Given with the `ssh` or `no-auth-ssh` service, the command instead
replaces the shell, like OpenSSH's `ForceCommand`: every SSH session
runs only that command (on a PTY if the client asks for one), and the
server offers no shell, no client-chosen command, and no SFTP. The
client's requested command, if any, arrives in `$SSH_ORIGINAL_COMMAND`.

```sh
$ tailcat serve --ssh-authorized-keys=alice@github ssh -- ./deploy.sh
$ tailcat serve no-auth-ssh -- git-upload-pack /srv/repo.git
```

### Send and receive files

To receive files, run a drop box and share the printed tailcat address:

```sh
$ tailcat recv ~/inbox
# 🐈 Server listening with new address: tcXXXXXXXXX
```

The sender then runs:

```sh
$ tailcat cp report.pdf tcXXXXXXXXX:
```

`tailcat cp` runs the system `scp` with the connection routed through
tailcat, so you get its usual progress display, and `-r` for
directory trees. The drop box is write-only: senders can't list the
directory, read anything back, or touch existing files.

To offer files instead, serve a directory read-only (the default) or
read-write:

```sh
$ tailcat serve files                  # current directory, read-only
$ tailcat serve --files=/pub:rw files  # a given directory, read-write
```

```sh
$ tailcat ls -l tcXXXXXXXXX
$ tailcat cp tcXXXXXXXXX:report.pdf .
```

`tailcat ls` speaks SFTP natively, so it works even without OpenSSH
installed.

The server confines all paths to the served directory (via Go's
`os.Root`), so neither `..` nor symlinks escape it. The file service
speaks SFTP, so the stock `sftp` and `scp` clients also work against
it, given a ProxyCommand that pipes through tailcat (the same trick
`tailcat cp` and `tailcat ssh` use). Both `ssh` and `no-auth-ssh`
servers serve SFTP too, with the same access as the shell.

Transfers are not compressed: the SFTP protocol has no compression
of its own, and the SSH transport here doesn't either (Go's SSH
stack omits it; transport compression has a history of security
problems, and TLS dropped it too). Compress files before sending
if it matters.

### Measure throughput and latency

Run an iperf-like test between two machines. The server accepts tests
with the `perf` service and the client sends to it for 10 seconds by
default, printing progress each second and both sides' totals at the
end. `--reverse` sends the other way, `--bidir` both ways at once,
`--udp` tests UDP (paced to `--bitrate`, default 1 Mbit/s) and reports
loss, reordering, and jitter, and `--parallel` runs several streams.
Round trips over the test's control connection measure latency while
the tunnel is loaded:

```sh
$ tailcat serve perf
# 🐈 Server listening with new address: tcXXXXXXXXX
```

```sh
$ tailcat perf tcXXXXXXXXX
# path: direct via 203.0.113.7:41641, rtt 1.2ms
TCP, client -> server, 1 stream, 10s
[   1.0s]  sent    118 MB    943 Mbit/s  rtt 2.1ms
...
sent        1.18 GB in   10.0s    943 Mbit/s
received    1.18 GB in   10.0s    942 Mbit/s
rtt under load  min 1.9ms  avg 2.3ms  max 4.1ms  (50 samples)
```

The test first waits for a direct path (up to `--timeout`) and refuses
to run through a DERP relay otherwise, since a throughput test through
a shared relay mostly measures its rate limit while crowding out
everyone else. `--via-derp` allows a relayed test through [a relay you
run yourself](#bring-your-own-derp-relay); Tailscale's shared relays
are always refused. `tailcat --json perf` prints the results as JSON.

### Log incoming connections

By default a server prints its address and then stays quiet. `--log`
adds an access log on stderr: one line when a client is allowed in,
and one when each of its TCP connections or UDP flows opens and
closes. A UDP flow closes after two minutes without traffic.

```sh
$ tailcat serve --log 8000
# 🐈 Server listening with new address: tcXXXXXXXXX
2026/01/30 11:04:02 [peer] allowed key=nodekey:abc123...
2026/01/30 11:04:02 [conn] open peer=nodekey:abc123... proto=tcp port=8000 service=forward via=derp:sfo
2026/01/30 11:04:11 [conn] close peer=nodekey:abc123... proto=tcp port=8000 service=forward duration=8.104s
```

Clients are identified by public key, the same value `--allow` takes.
A client's tailcat address is derived from its key, so it isn't
logged. The `via` field is the only one with a real network address,
and only once a direct path has replaced the DERP relay.

With `--allow` set, clients that aren't on the list are logged too,
once per key:

```
2026/01/30 11:07:30 [peer] refused key=nodekey:def456... reason=not-in-allow
```

This is separate from `--verbose`, which turns on the underlying
library's debug logging. Both can be set at once, and the `[peer]` and
`[conn]` tags stay greppable either way.

### Misc commands 

Ping to test connectivity; each pong reports whether it arrived via a
DERP relay or a direct path. `--until-direct` keeps pinging (up to
`--timeout`, default 10s) until a direct path works, exiting non-zero
if one doesn't:

```sh
$ tailcat ping --until-direct <tc-addr>
pong in 42.1ms via DERP(sfo)
pong in 1.2ms via 203.0.113.7:41641
```

Run a command through a SOCKS5 proxy routed over the tunnel:

```sh
$ tailcat socks <tc-addr> curl http://server.tailcat:8081/
```

Tailcat addresses also work directly as URL hostnames: the SOCKS proxy recognizes
and dials them, so the tailcat address argument is optional. (Tailcat addresses are
case-sensitive; this works with curl and most CLI tools, but not with
browsers, which lowercase hostnames.)

```sh
$ tailcat socks curl http://<tc-addr>:8081/
```

Act as an exit node so the client can reach the server's network:

```sh
$ tailcat serve exit-node
```

Parse a tailcat address and print its contents (the server's WireGuard
public key and DERP info) as JSON, without connecting to anything:

```sh
$ tailcat parse tcomFwWCCcjS5nKNqAod034nWoJZW0LZqDhhC8U_dKdnDRYQ8uNGFpGQEu
{
    "ServerPublic": "nodekey:9c8d2e6728da80a1dd37e275a82595b42d9a838610bc53f74a7670d1610f2e34",
    "RegionID": 302
}
```

Resolve a short tailcat address (which references a DERP region by ID, requiring
clients to fetch the DERP map) into a longer self-contained one with the
DERP server info embedded, letting clients connect more quickly:

```sh
$ tailcat resolve tcomFwWCCcjS5nKNqAod034nWoJZW0LZqDhhC8U_dKdnDRYQ8uNGFpGQEu
tcomFwWCCcjS5nKNqAod034nWoJZW0LZqDhhC8U_dKdnDRYQ8uNGFygaFhToGjYWhudGMzMDJhLmlwbi5kZXZhNG0yMDguMTExLjM5LjM4YTZzMjYwNzpmNzQwOjA6M2Y6OjcyMA
```

Parsing that resolved tailcat address shows the embedded DERP info:

```sh
$ tailcat parse tcomFwWCCcjS5nKNqAod034nWoJZW0LZqDhhC8U_dKdnDRYQ8uNGFygaFhToGjYWhudGMzMDJhLmlwbi5kZXZhNG0yMDguMTExLjM5LjM4YTZzMjYwNzpmNzQwOjA6M2Y6OjcyMA
{
    "ServerPublic": "nodekey:9c8d2e6728da80a1dd37e275a82595b42d9a838610bc53f74a7670d1610f2e34",
    "Region": [
        {
            "Nodes": [
                {
                    "HostName": "tc302a.ipn.dev",
                    "IPv4": "208.111.39.38",
                    "IPv6": "2607:f740:0:3f::720"
                }
            ]
        }
    ]
}
```

A server can print the long self-contained form directly with the
`tailcat serve --full-address` flag.

## Key Management

A server's tailcat address contains its WireGuard public key and an independent
WireGuard pre-shared key, so the saved key material determines who can reach you:

* **Ephemeral keys (the default):** each server run generates a fresh key in
  memory and prints an address nobody has ever seen. When the process exits,
  the key is discarded and the address is dead forever. This is the safe
  default: sharing that address only ever refers to that one run.

* **Saved keys:** `tailcat genkey` generates a key saved to disk so the
  address stays stable across restarts. The flip side: anyone you've *ever*
  shared that address with can connect to any future server using that key,
  unless you restrict clients with `tailcat serve --allow` (see
  `tailcat genkey --client`).

The CLI says at startup which kind it's using, so you know whether you're
starting a fresh single-use server or re-listening on an address you may
have shared in the past.

WireGuard pre-shared keys are enabled by default and strongly recommended. For
compatibility with tailcat clients v0.5.0 and earlier, `--psk=false` on `serve`
or `genkey` produces shorter addresses, but removes post-quantum protection and
protection from public DERP operators that observe the peers' public keys.

The pre-shared key's post-quantum protection only lasts while the address
stays secret. The experimental `tailcat serve --hybrid` flag instead uses
a hybrid post-quantum (ML-KEM-768) WireGuard handshake, which protects
recorded traffic even when the address is public, such as in a DNS TXT
record. A hybrid address still contains a pre-shared key by default, to
keep out DERP operators, but a shorter 128-bit one, so the address is
shorter too.
Clients need a tailcat version with hybrid support; older clients reject
hybrid addresses.

```sh
$ tailcat genkey --key=default --region=nyc
# prints the tailcat address; key saved to ~/.config/tailcat/keys/default.private.json

# later; the key named "default" is used automatically once it exists:
$ tailcat serve 8080
# 🐈 Server listening with saved key "default": tcXXXXXXXXX

# ... unless you force a one-off ephemeral key:
$ tailcat serve --key=new 8080
# 🐈 Server listening with new address: tcXXXXXXXXX
```

That is, `default` is a magic key name: once it exists, plain `tailcat`
silently uses it instead of generating an ephemeral key, and the startup
line above is what tells you which happened. Use `--key=new` to get an
ephemeral key anyway, `--key=<name>` to use a different saved key, or
`tailcat genkey --delete --key=default` to remove the saved default key.
`tailcat genkey --list` lists your saved keys.

Tailcat addresses can al
↑