# web-terminal **Repository Path**: guohao88/web-terminal ## Basic Information - **Project Name**: web-terminal - **Description**: 基于go写的web ssh连接客户端 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-05-14 - **Last Updated**: 2024-05-28 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SSH Web 客户端和文件上传功能 这个项目是一个简单的 SSH Web 客户端,使用 Go 和 xterm.js 构建。它允许用户通过 Web 界面连接到 SSH 服务器,执行命令并从本地计算机上传文件到远程服务器。 ## 功能 - 使用 xterm.js 进行 SSH 终端模拟 - 使用上下箭头键导航命令历史 - 实时命令输出 - 支持复制 (Ctrl+C) 和粘贴 (Ctrl+V) 文本 ## 先决条件 - Go (1.21.3) - 你有访问权限的 SSH 服务器 - Web 浏览器 (Chrome, Firefox 等) ## 安装 1. 克隆此仓库: ```sh git clone https://gitee.com/guohao88/web-terminal.git cd web-terminal ``` 2. 将 HTML 和 Go 文件放在项目目录中。确保以下结构: ``` . ├── main.go ├── static │ └── index.html └── README.md ``` 3. 在启动后访问http://localhost:8080页面进行ssh登录: ![输入图片说明](static/image.png) ## 使用方法 1. 启动 Go 服务器: ```sh go run main.go ``` 2. 打开你的 Web 浏览器并导航到 `http://localhost:8080`。 3. 你会看到一个 SSH 终端界面。像使用普通的 SSH 终端一样使用它。 ## 项目结构 - `main.go`: 处理 SSH 连接和 WebSocket 通信的主要 Go 应用程序。 - `static/index.html`: 使用 xterm.js 进行终端模拟和文件上传功能的 Web 界面。