Files
remote-core/shell/README.md
T
4566704 181150b7a1 docs: 补齐 common/file/process/shell 四个既有包的 README
- 每包定位/路由表/用法与注意事项(鉴权告诫、录制审计、防误杀语义)
- 至此 remote-core 全部包 README 覆盖
2026-09-20 12:50:55 +08:00

28 lines
889 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# shell
被控端 Web 终端(自 remote-backend-server internal/handlers/shell 移植,去 DB
依赖):WebSocket 交互式终端(Windows ConPTY / Unix pty)+ asciinema 会话录制。
## 路由
```go
import "git.zeroonesoft.cn/golib/remote-core/shell"
shell.RegisterRoutersWebShell(r *gin.RouterGroup, recDir)
```
| 方法 | 路径 | 说明 |
|---|---|---|
| GET | `/web/shell` | WebSocket 升级,启动终端(Windows 优先 powershell.exe,缺失回退 cmd.exe;Unix 为 bash) |
| GET | `/web/shell/record` | 录制文件列表 |
## 协议
WebSocket JSON 信封 `OpDataType{op, data}`:输入/输出流与 `resize`(`ResizeDataType`
调整行列)走同一连接。
## 注意
- 录制为 asciinema 格式,落盘 `recDir`,可用 asciinema 播放器回放审计。
- `CheckOrigin` 放开所有来源(跨域),接入公网必须由网关侧补鉴权。