Aude Code

aude-tunnel(7)

NAME

aude-tunnel — 哪些其他设备可以访问这台计算机上的 aude 会话

SYNOPSIS

aude tunnel tailnet | funnel | trycloudflare | none

DESCRIPTION

因为 aude-rc(7) 的监听器只在 127.0.0.1 监听,所以只有这台计算机能访问它。隧道让其他设备能访问监听器。

‘aude tunnel’ 在必要时启动监听器。监听器写入 tunnel.json。 ‘aude tunnel’ 打印新的可达信息:URL 和它的二维码。如果没有已列入的设备,并且没有打开的配对窗口,它只打印 ‘tunnel <word>’ 这一行。

监听器在监听期间,运行它在 PATH 中找到的隧道程序。程序随监听器一起停止。如果所有 aude 进程都收到 SIGKILL,程序会继续运行。打开配对窗口时,或以同一个词运行 ‘aude tunnel’ 时,失败的程序会重新启动。

TUNNELS

这台机器的 tailnet 中的设备通过 ‘tailscale serve’ 访问监听器。必须运行 Tailscale 1.52.0 或更高版本。登录 Tailscale。在 tailnet 中开启 HTTPS 证书。在 Linux 上,将 ‘sudo tailscale set --operator=$USER’ 运行一次。
互联网通过 ‘tailscale funnel’ 访问监听器。还要在 tailnet 策略中为这台机器开启 Funnel。
互联网通过 ‘cloudflared’ 2025.6.1 或更高版本的快速隧道访问监听器,无需账号。名称在每次启动时都会改变,因此要扫描新的 URL。
只有这台计算机能访问监听器,与没有 tunnel.json 时相同。

使用隧道时,URL 包含隧道的域名,不含端口:

AUDE:<name>/<fingerprint>
名称为大写。在名称中,$ 代替 .trycloudflare.com,+ 代替 .ts.net。设备通过 TLS 向该名称的 443 端口拨号。隧道提供 TLS 证书。指纹证明机器的身份。

FILES

~/.aude/rc/tunnel.json
一个 JSON 字符串,即隧道的词:
"trycloudflare"
‘aude tunnel’ 会写入它。没有 aude 进程运行时,你也可以写入它。

EXIT STATUS

‘aude tunnel’ 打印开放或关闭的可达信息时,退出码为 0。隧道或端口失败时,退出码为 8。 aude 无法读取或写入文件时,退出码为 6。对于未知的词,退出码为 64。

EXAMPLES

$ aude tunnel trycloudflare
  devices reach this machine at AUDE:<name>$/<fingerprint>: my phone

  <the QR code>
$ aude devices
this machine  CIWVK7ZHMCBW6Z5BRVKUL6VJGK7Z
tunnel  trycloudflare
my phone  43MINEMOLU2QDYIRISB6HVGMMF6X

DIAGNOSTICS

devices cannot reach this machine: the <tunnel> tunnel <finding> — see aude-tunnel(7)
检查结果为以下之一:
has no program on PATH
安装该程序。
has a program older than aude needs
更新该程序。
has a service that does not run, or is logged out
启动 Tailscale。然后登录。
is refused by its provider
开启 HTTPS 证书。使用 funnel 时,还要开启 Funnel。
did not serve in time, exited <n>, was killed by signal <n>, wrote a line past <n> bytes, could not start its program: <reason>
手动运行该程序,查看原因。快速隧道服务可能拒绝它,或者网络可能阻止它。
does not know if its program still runs
如果该程序仍在运行,停止它。
rc could not read tunnel.json: <defect>
‘aude devices’ 的退出码为 6。运行 ‘aude tunnel’ 命令。
unknown tunnel '<word>' — available: funnel none tailnet trycloudflare
 
could not attach — this platform has no TLS client; attach from a Mac or a phone
Linux 上的终端无法向隧道拨号。

SEE ALSO

aude(1), aude-rc(7), aude-workflow(7)

CAVEATS

使用 funnel 和 trycloudflare 时,任何找到该名称的人都能访问监听器。监听器拒绝它未列入的设备。但当其他设备占满所有握手槽位时,你的设备无法附加。

隧道的运营方能看到谁在拨号、何时拨号以及数据量,并可以停止隧道。运营方无法读取数据。

TLS 证书的公开日志会显示 tailnet 和 funnel 的名称。

监听器未在 Tailscale 的隧道上测试过。