{"id":21803051,"url":"https://github.com/litongjava/websocket-ssh-client","last_synced_at":"2026-05-11T03:37:19.681Z","repository":{"id":215045092,"uuid":"737983534","full_name":"litongjava/websocket-ssh-client","owner":"litongjava","description":"websocket-ssh-client","archived":false,"fork":false,"pushed_at":"2024-06-16T01:22:58.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-26T04:09:33.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litongjava.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-02T06:11:07.000Z","updated_at":"2024-06-16T01:23:01.000Z","dependencies_parsed_at":"2024-06-16T02:49:11.332Z","dependency_job_id":"2ae9c722-aa85-4e1c-ba3d-b5bc832fb70d","html_url":"https://github.com/litongjava/websocket-ssh-client","commit_stats":null,"previous_names":["litongjava/websocket-ssh-client"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fwebsocket-ssh-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fwebsocket-ssh-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fwebsocket-ssh-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litongjava%2Fwebsocket-ssh-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litongjava","download_url":"https://codeload.github.com/litongjava/websocket-ssh-client/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244752362,"owners_count":20504256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-27T11:37:44.931Z","updated_at":"2026-05-11T03:37:19.640Z","avatar_url":"https://github.com/litongjava.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Websocket-SSH-Client\n## 1. 简介\nWebsocket-SSH-Client是一个基于Go语言开发的服务，它允许SSH客户端通过Websocket连接到远程ssh服务器。以下是该服务的工作流程：\n\n1. **SSH客户端**：这是流程的起点，SSH客户端尝试建立一个连接。\n\n2. **Websocket-SSH-Client**：SSH客户端连接到运行在22端口的Websocket-SSH-Client。这个服务的作用是将SSH协议转换为WSSS协议，这是一个基于HTTP和WSS的协议。\n\n3. **Websocket-SSH-Server**：Websocket-SSH-Client通过WSSS协议连接到运行在5501端口的Websocket-SSH-Server。Websocket-SSH-Server接收到WSSS协议的数据，并将其转换回SSH协议。\n\n4. **SSH服务器**：最后，Websocket-SSH-Server作为SSH客户端，连接到SSH服务器。\n\n以下是这个流程的图示：\n\n```markdown\n1. SSH Client\n    |\n    | SSH\n    |\n2. Websocket-SSH-Client (Port 22)\n    |\n    | WSSS (HTTP \u0026 WSS)\n    |\n3. Websocket-SSH-Server (Port 5501)\n    |\n    | SSH\n    |\n4. SSH Server\n```\n\n## 2. 安装Websocket-SSH-Server\nWebsocket-SSH-Server（简称WSSS）是一个基于Go语言开发的服务，它允许Websocket-SSH-Client进行连接。以下是安装和配置WSSS的步骤：\n\n### 2.1 安装\n首先，你需要下载并解压Websocket-SSH-Server的安装包。你可以使用以下命令来完成这个步骤：\n\n```bash\nmkdir /opt/package/wsss -p \u0026\u0026 cd /opt/package/wsss/\n## put to websocket-sshd-server-linux-amd64-v1.0.0.tar.gz to here\n## curl -O http://192.168.3.8:3000/websocket-sshd-server/websocket-sshd-server-linux-amd64-v1.0.0.tar.gz\ntar -xf websocket-sshd-server-linux-amd64-v1.0.0.tar.gz -C /usr/local/\n```\n\n然后，你可以使用以下命令来启动Websocket-SSH-Server：\n\n```bash\n/usr/local/websocket-sshd-server/websocket-ssh-server -c /usr/local/websocket-sshd-server/config.yml\n```\n\n启动后，Websocket-SSH-Server将默认监听5001端口。\n\n### 2.2 配置Nginx（可选）\n如果你想通过Nginx代理Websocket-SSH-Server，你可以添加以下配置到你的Nginx配置文件中：\n\n```nginx\nlocation /wsss { ## 后端项目 - 用户 wsss\n    proxy_pass http://localhost:5001;\n    proxy_set_header Host $http_host;\n    proxy_set_header X-Real-IP $remote_addr;\n    proxy_set_header REMOTE-HOST $remote_addr;\n    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection \"upgrade\";\n}\n```\n\n然后，你可以使用以下命令来重载Nginx配置：\n\n```bash\nnginx -s reload\n```\n\n现在，你可以通过`http://192.168.3.9/wsss/`来访问Websocket-SSH-Server。\n\n### 2.3 配置开机启动（可选）\n如果你希望Websocket-SSH-Server在系统启动时自动运行，你可以创建一个systemd服务。首先，使用以下命令创建一个服务文件：\n\n```bash\nvi /etc/systemd/system/wsss.service\n```\n\n然后，将以下内容复制到服务文件中：\n\n```ini\n[Unit]\nDescription=wsss\nAfter=network.target\n\n[Service]\nType=simple\nUser=root\nRestart=on-failure\nRestartSec=5s\nWorkingDirectory = /usr/local/websocket-sshd-server\nExecStart=/usr/local/websocket-sshd-server/websocket-ssh-server -c /usr/local/websocket-sshd-server/config.yml\n\n[Install]\nWantedBy=multi-user.target\n```\n\n最后，你可以使用以下命令来启动和管理你的服务：\n\n```bash\nsystemctl daemon-reload\nsystemctl enable wsss\nsystemctl start wsss\nsystemctl status wsss\nsystemctl stop wsss\n```\n### docker启动\n```shell\ndocker run -dit --name=wsss -p 5001:5001 litongjava/wsss:1.0.0\n```\n## 3. 安装Websocket-SSH-Client\nWebsocket-SSH-Client是一个基于Go语言开发的SSH客户端，它允许你通过Websocket连接到SSH服务器。以下是安装和使用Websocket-SSH-Client的步骤：\n\n### 3.1 下载\n你可以从以下地址下载Websocket-SSH-Client的最新版本：\n\n[https://github.com/litongjava/websocket-ssh-client/releases](https://github.com/litongjava/websocket-ssh-client/releases)\n\n### 3.2 运行\n首先，你需要创建一个配置文件`config.yml`，并填入以下内容：\n\n```yaml\napp:\n  host: 127.0.0.1\n  port: 22\n  endPoint: ws://192.168.3.9:5001/wsss/socket\n```\n\n然后，你可以使用以下命令来运行Websocket-SSH-Client：\n```\n\n```\n\n然后使用ssh客户端连接Websocket-SSH-Client\n```bash\nssh {username}@{target-host}:{target-host-sshd-port}:{websocket-ssh-client-ip}\n```\n\n其中：\n\n- `{username}`：这是你要以其身份登录到远程主机的用户的用户名。\n- `{target-host}`：这是你要连接的远程主机的IP地址或主机名。\n- `{target-host-sshd-port}`：这是远程主机上运行的SSH服务器（sshd）的端口号。\n- `{websocket-ssh-client-ip}`：这是运行Websocket-SSH-Client的主机的IP地址。\n\n例如，如果你想以`root`用户的身份连接到本地主机（IP地址为`127.0.0.1`）的22端口，并且Websocket-SSH-Client也运行在本地主机上，你可以使用以下命令：\n\n```bash\nssh root@127.0.0.1:22@127.0.0.1\n```\n\n这是一份为初学者编写的文档，希望你能从中获得所需的信息。如果你有任何问题或需要进一步的帮助，请随时向我提问！","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitongjava%2Fwebsocket-ssh-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitongjava%2Fwebsocket-ssh-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitongjava%2Fwebsocket-ssh-client/lists"}