From b730e28b1a0eb1e9c4462e6221e541ac73582306 Mon Sep 17 00:00:00 2001 From: claude_dev Date: Mon, 29 Jun 2026 22:17:24 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0tmux=20web=E8=AE=BF?= =?UTF-8?q?=E9=97=AE=E6=96=B9=E6=A1=88=E8=B0=83=E7=A0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../02-videotext-investigation-report.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/docs/design/02-videotext-investigation-report.md b/docs/design/02-videotext-investigation-report.md index 8c29ca5..2acfeec 100644 --- a/docs/design/02-videotext-investigation-report.md +++ b/docs/design/02-videotext-investigation-report.md @@ -434,4 +434,99 @@ glm-5.2 --- +## 十三、tmux Web 访问方案(补充调研) + +### 13.1 可行方案 + +**推荐工具:gotty** - 将 tmux 会话共享为 web 应用 + +### 13.2 方案一:gotty(推荐) + +#### 安装 + +**Mac (Homebrew)**: +```bash +brew install yudai/gotty/gotty +``` + +**Go 环境**: +```bash +go get github.com/yudai/gotty +``` + +#### 基本使用 + +**1. 启动 tmux 会话** +```bash +tmux new -s mysession +``` + +**2. 用 gotty 共享 tmux 会话** +```bash +gotty tmux attach -t mysession +``` + +**3. 访问** +- 本地访问: `http://localhost:8080` +- 局域网访问: `http://YOUR_LAN_IP:8080` + +#### 局域网配置 + +**命令行参数**: +```bash +gotty -a 0.0.0.0 -p 8080 tmux attach -t mysession +``` + +**配置文件 (~/.gotty)**: +``` +address = "0.0.0.0" +port = "8080" +permit_write = true +enable_basic_auth = false +``` + +**查看本机 IP**: +```bash +ifconfig | grep inet +# 或 +ip addr show +``` + +### 13.3 方案二:webtmux(专为 tmux 设计) + +**GitHub**: https://github.com/chrismccord/webtmux + +**特点**: +- 基于 gotty,专门为 tmux 优化 +- 可视化面板布局 +- 触摸友好控制 +- 更好的移动端支持 + +**基本使用**: +```bash +# 克隆项目 +git clone https://github.com/chrismccord/webtmux +cd webtmux +make + +# 运行 +./webtmux --address 0.0.0.0 --port 8080 +``` + +### 13.4 局域网访问要点 + +| 配置项 | 说明 | +|--------|------| +| **bind 0.0.0.0** | 监听所有网络接口(允许局域网访问) | +| **防火墙** | 确保端口 8080 未被阻止 | +| **获取 IP** | `ifconfig` 或 `ip addr` 查看局域网 IP | + +**访问地址示例**: +``` +http://192.168.1.100:8080 +http://192.168.2.154:8080 +``` + +--- + **报告结束**