GreenhandTan 4b04c07f0f feat: 完善核心功能并完成开源准备
- 修复 AES-GCM 数据包 Padding 计算错误
- 修复 SSH Keepalive 心跳包导致自动断开的问题,引入 Global Request 处理
- 将 WebSocket 实现迁移至 Durable Object Hibernation API,支持超长会话
- 前端添加动态版权年份,并精简控制台 Debug 输出
- 添加中英文双语 README 帮助文档
- 清理测试产生的日志与临时文件
2026-06-14 11:02:15 +08:00
2026-06-12 15:08:05 +08:00

CloudSSH

A Serverless Web SSH Terminal built on Cloudflare Workers: Connect and manage your servers directly from the browser.

Ultra-lightweight · Out-of-the-box · Cyberpunk UI

Stars License Cloudflare TypeScript React

Highlights · Features · Deployment · Architecture · License

简体中文 | English

Tip

CloudSSH utilizes Cloudflare Workers' TCP Sockets support to handle SSH protocol parsing and forwarding at edge nodes, providing a low-latency Web Terminal experience.

Demo

Imagine opening your browser anytime, anywhere, and connecting to your server with a highly futuristic cyberpunk UI, without installing any SSH client.

Table of Contents

Highlights

Ultimate Serverless

  • Zero Server Cost: Pure frontend deployment + Cloudflare Workers, no need to build your own backend servers.
  • Edge Acceleration: Benefit from Cloudflare's global edge network, enjoying low-latency SSH connections from anywhere.

Out of the Box

  • One-Click Deployment: Build and deploy the project with a single command using the Wrangler CLI.
  • Modern Frontend Stack: React + TypeScript + Vite + Tailwind CSS, paired with xterm.js to provide a silky smooth terminal experience.

Secure and Reliable

  • End-to-End Encryption: Complete implementation of the SSH-2.0 protocol, including ECDH key exchange, Ed25519 signature authentication, and AES-256-GCM data encryption.
  • Isolated Session State: Leveraging Cloudflare Durable Objects and the Hibernation API, every terminal session runs securely and persistently within its sandbox.

Features

  • Full SSH Handshake: Native TypeScript implementation of the SSH transport layer and user authentication protocols.
  • Password Authentication: Supports standard SSH password authentication.
  • Full-Featured Terminal: Based on xterm.js, supporting color output and adaptive window resizing (Window Adjust).
  • Persistent Connections: Built on the Durable Objects WebSocket Hibernation API, maintaining long-lived stable SSH connections with Keepalive support.
  • Responsive UI: Beautiful login panel and status bar, fully compatible with mobile access.

Architecture

flowchart TB
    Browser["Browser Client<br/>(React + xterm.js)"]
    CF["Cloudflare Edge Network"]
    DO["Durable Object<br/>(SSH Session Management)"]
    Server["Target SSH Server<br/>(e.g., Linux VPS)"]

    Browser <-->|"WebSocket<br/>(Frontend UI Input & Terminal Output)"| CF
    CF <-->|"WebSocket"<br/>Routing & Long-lived Connection| DO
    DO <-->|"TCP Socket<br/>@cloudflare/sockets"| Server
  1. The user enters the host IP, username, and password on the frontend.
  2. The frontend establishes a WebSocket connection with the backend Durable Object.
  3. The DO receives the credentials and establishes a TCP connection with the target SSH server using @cloudflare/sockets.
  4. The DO handles the entire SSH protocol negotiation (key exchange, password auth, etc.) in pure code and forwards the encrypted terminal data to the frontend via WebSocket.

Quick Deployment

Prerequisites

  • A Cloudflare account.
  • Node.js environment (v18+).
  • Cloudflare Workers Paid Plan enabled (required for TCP Sockets and Durable Objects features).

Steps

  1. Clone the Repository

    git clone https://github.com/newbietan/CloudSSH.git
    cd CloudSSH
    
  2. Install Dependencies

    npm install
    
  3. Login to Cloudflare

    npx wrangler login
    
  4. One-Click Deploy

    npm run deploy
    

Once deployed, Wrangler will output your Worker URL. Open that URL in your browser to start using your Web SSH terminal.

Development

This project consists of two parts:

  1. Frontend: Located in the frontend/ directory, built with Vite.
  2. Worker: Located in the src/ directory, containing the Cloudflare Worker entry point and the core SSH protocol implementation.

For local development, you can run:

npm run dev

This command starts Wrangler's local development environment server.

License

This project is open-sourced under the MIT License. Issues and Pull Requests are welcome to help build the community.

S
Description
Serverless Web SSH client built on Cloudflare Workers with a pure TypeScript SSH stack, multi-session terminals, SFTP file management, and an AI operations assistant. 基于 Cloudflare Workers 的无服务器 Web SSH 客户端,支持多会话终端、SFTP 文件管理与 AI 运维助手。
https://ssh.newbietan.cn
Readme
5.7 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 93.9%
CSS 3.5%
HTML 2.1%
JavaScript 0.5%