SuperAPI AI 工具集

tailscale

部署与运维

查看项目

更新于 10-15 19:55

技能介绍

用途:该参考用于通过 Tailscale 共享本地服务。Serve 仅在 tailnet 内私有共享,Funnel 则把端口公开到互联网,适合内网工具、Webhook 端点和远程访问机器人等场景。

主要能力:聊天命令支持 /tailscale serve 3000(共享端口)、serve 3000 --path /api(指定路径)、serve stop 3000、serve status;Funnel 对应 /tailscale funnel 3000、funnel 3000 --https、funnel stop 3000、funnel status;另有 status、ip、peers、ping <peer> 查询网络,以及 send <file> <peer>、receive 传输文件。

TypeScript 用法:从 'clodds/tailscale' 导入 createTailscaleClient,传入 authKey(可选)与 socketPath(默认 /var/run/tailscale/tailscaled.sock)。调用 tailscale.serve({ port, protocol, path, hostname }) 私有共享,serveStop、serveStatus 管理;tailscale.funnel({ port, protocol, hostname }) 公开,funnelStop、funnelStatus 管理。status() 返回 hostname、ip、tailnet、online;peers() 列出对端;ping() 返回延迟;sendFile() / receiveFile() 传文件;getIP() 返回 100.x.x.x 地址。

限制与要求:需安装并运行 Tailscale 且已登录 tailnet;Funnel 还需在管理后台启用。Funnel 绕过 Tailscale 身份认证,公开端点应自行加认证,谨慎使用并及时停止共享。