rtty

zhaojh329MIT活跃维护

通过浏览器远程访问设备终端,穿透 NAT 和内网限制,提供 WebSSH、远程控制与调试能力。

🐛 Access your device from anywhere via the web.

v9.2.1发布于 2026-10-13 01:28 UTC4,051star551fork同步于 2026-11-10 23:40 UTC

怎么上手

由 README 提炼,执行前请确认
README 未给出具体安装命令,请参考官方安装与使用指南:https://zhaojh329.github.io/rtty/#/docs
硬件要求按 README 说明

README 未说明具体硬件或显存要求,仅说明 C 客户端面向嵌入式 Linux 和资源受限设备,客户端支持 Linux 与 OpenWrt 环境。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

轻量级远程访问方案,通过浏览器管理 NAT 后的 Linux 和 OpenWrt 设备

通过浏览器远程访问设备终端,穿透 NAT 和内网限制,提供 WebSSH、远程控制与调试能力。

核心能力

  • C 客户端超轻量,面向嵌入式 Linux 与资源受限设备
  • 客户端主动连接 rttys 服务器,NAT 后设备无需公网 IP
  • 浏览器内 Xterm.js 终端,支持窗口分屏与虚拟键盘
  • 支持文件上传下载、HTTP 代理访问设备 Web 界面、TCP 端口转发
  • 支持 TLS 与可选 mTLS 证书双向认证,可批量下发命令

容易踩的坑

需要自行部署 rttys 服务端,本仓库只包含 C 客户端;C 客户端编译依赖 libev 和 inih,启用 SSL 还需另装 OpenSSL、mbedtls 或 wolfssl 之一;浏览器与设备客户端都必须能访问到 rttys 服务器。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v9.2.1
  1. v9.2.1最新正式版2026-10-13 · 2026-10-13 01:28 UTC

    Bug Fixes

    • Keep heartbeats and HTTP timeouts reliable after clock changes

      • Use monotonic timing so system clock adjustments, such as NTP synchronization, do not delay heartbeats, dead connection detection, or cleanup of idle HTTP proxy connections.
    • Validate remote command messages

      • Check string boundaries, token length, and parameter counts before executing commands. Reject malformed messages to prevent out-of-bounds reads and buffer overflows.
    • Handle malformed registration responses safely

      • Reject empty responses and limit registration error messages to the available buffer size, preventing stack buffer overflows.
    • Fix command timeout cleanup

      • Log the command before freeing its task, avoiding a use-after-free when a remote command times out.
    • Avoid unaligned memory access in protocol messages

      • Write registration and heartbeat message lengths safely on CPUs that do not support unaligned memory access.
    • Fix empty HTTP proxy notifications

      • Avoid passing a null pointer to a memory copy when reporting a closed connection with no payload.
    • Respect custom OpenSSL installations

      • Use the include and library paths discovered by pkg-config, preventing builds from accidentally using the system OpenSSL instead.

    Improvements

    • Update TLS library compatibility

      • Support OpenSSL 4.x and Mbed TLS 4.x, while retaining Mbed TLS 2.x and 3.x compatibility. Handle Mbed TLS TLS 1.3 session ticket notifications without treating them as connection failures.
    • Expand automated build coverage

      • Restore builds for pull requests and add dedicated OpenSSL 4.x and Mbed TLS 4.x jobs that verify linkage to the intended libraries.

    Full Changelog: https://github.com/zhaojh329/rtty/compare/v9.2.0...v9.2.1


    问题修复

    • 修复系统时间调整后的心跳和 HTTP 超时处理

      • 使用单调计时,避免 NTP 校时等系统时间调整导致心跳发送、失效连接检测或 HTTP 代理空闲连接清理被延迟。
    • 完善远程命令消息校验

      • 在执行命令前检查字符串边界、令牌长度和参数数量,拒绝格式错误的消息,防止越界读取和缓冲区溢出。
    • 安全处理异常注册响应

      • 拒绝空响应,并将注册错误信息限制在缓冲区容量内,防止栈缓冲区溢出。
    • 修复命令超时清理问题

      • 在释放任务前记录命令日志,避免远程命令超时时访问已释放的内存。
    • 避免协议消息中的未对齐内存访问

      • 安全写入注册和心跳消息的长度字段,避免在不支持未对齐内存访问的 CPU 上发生故障。
    • 修复 HTTP 代理空消息通知处理

      • 发送不含数据的连接关闭通知时,不再将空指针传给内存复制操作。
    • 正确使用自定义路径的 OpenSSL

      • 使用 pkg-config 检测到的头文件和库路径,避免构建时意外使用系统自带的 OpenSSL。

    改进优化

    • 更新 TLS 库兼容性

      • 支持 OpenSSL 4.x 和 Mbed TLS 4.x,同时保留对 Mbed TLS 2.x 和 3.x 的兼容。正确处理 Mbed TLS 的 TLS 1.3 会话票据通知,避免将其误判为连接失败。
    • 扩展自动化构建覆盖

      • 恢复拉取请求的自动构建,并新增 OpenSSL 4.x 和 Mbed TLS 4.x 专用构建任务,检查是否链接到预期的库。

    完整变更记录: https://github.com/zhaojh329/rtty/compare/v9.2.0...v9.2.1

  2. v9.2.02026-10-02 · 2026-10-02 13:09 UTC
    查看更新说明

    Bug Fixes

    • Verify TLS server identity

      • Fix missing server hostname verification and apply the final certificate verification setting before creating TLS sessions. Verification is enabled by default; the explicit --insecure option remains available.
    • Prevent stalled TLS reads

      • Drain available TLS data on each read event so data buffered inside the TLS library is not left waiting for another socket event.
    • Reject truncated terminal messages

      • Validate message length before reading the session ID, preventing invalid parsing of incomplete terminal messages.
    • Make terminal file transfers more reliable

      • Improve transfer control, cancellation, and error reporting. Files uploaded from the browser to the device are written to temporary files and finalized only after successful receipt, without overwriting existing files. Canceled transfers clean up temporary files, and Ctrl+C restores terminal settings.

    Improvements

    • Allow startup without root privileges or the login program

      • The client can now start and connect to the server as a non-root user or on systems without login. Shell sessions still require root privileges and the login program. Non-root operation skips writes to /var/run/rtty to avoid permission errors.
    • Show average file transfer speed

      • Terminal file transfer progress now displays average throughput, with total elapsed time included when the transfer completes.
    • Simplify build dependencies

      • Remove the unused libcrypt dependency, so its development package is no longer required to build the client.

    New Features

    • Serial port forwarding

      • Add support for listing device serial ports and opening remote serial terminal sessions with configurable baud rate, data bits, stop bits, and parity.
    • TCP port forwarding

      • Add support for accessing TCP services reachable from connected devices, with flow control and TCP half-close handling.

    Full Changelog: https://github.com/zhaojh329/rtty/compare/v9.1.0...v9.2.0


    问题修复

    • 修复 TLS 服务端身份校验

      • 修复缺失的服务端主机名校验,并在创建 TLS 会话前应用最终的证书校验设置。默认启用校验,同时保留显式指定的 --insecure 选项。
    • 避免 TLS 数据读取停滞

      • 在每次读事件中读取所有当前可用的 TLS 数据,避免 TLS 库内部已缓存的数据滞留、等待下一次套接字事件。
    • 拒绝不完整的终端消息

      • 在读取会话 ID 前检查消息长度,避免对不完整的终端消息进行错误解析。
    • 提升终端文件传输可靠性

      • 改进传输控制、取消操作和错误反馈。从浏览器上传到设备的文件先写入临时文件,完整接收成功后再保存为目标文件,且不会覆盖已有文件。取消传输时清理临时文件,按 Ctrl+C 后恢复终端设置。

    改进优化

    • 支持非 root 用户及无 login 程序的环境启动

      • 客户端现在可由非 root 用户启动,也可在未安装 login 的系统上启动并连接服务端。Shell 会话仍需 root 权限和 login 程序。非 root 运行时跳过写入 /var/run/rtty,避免权限错误。
    • 显示文件平均传输速度

      • 终端文件传输进度现在显示平均传输速度,并在传输完成时显示总耗时。
    • 精简构建依赖

      • 移除未使用的 libcrypt 依赖,构建客户端不再需要安装其开发包。

    新功能

    • 串口转发

      • 支持列出设备串口并打开远程串口终端,可配置波特率、数据位、停止位和校验方式。
    • TCP 端口转发

      • 支持访问已连接设备可达的 TCP 服务,具备流量控制和 TCP 半关闭处理能力。

    完整变更记录: https://github.com/zhaojh329/rtty/compare/v9.1.0...v9.2.0

  3. v9.1.02026-05-07 · 2026-05-07 13:59 UTC
    查看更新说明

    Features

    • Added INI configuration file support (via libinih) to simplify deployment and runtime parameter management.
    • Added configurable HTTP idle timeout with the --http-timeout option.

    Bug Fixes

    • Fixed download free-space check behavior when mount entries are missing.

    特性

    • 新增 INI 配置文件支持(基于 libinih),便于统一管理运行参数与部署配置。
    • 新增 HTTP 空闲超时参数 --http-timeout,连接管理更灵活。

    修复

    • 修复挂载项缺失场景下下载可用空间检查异常的问题。
  4. v9.0.42025-12-04 · 2025-12-04 06:46 UTC
    查看更新说明

    Overview

    This release addresses a critical stability issue in the HTTP proxy functionality and improves build system compatibility.

    Changes

    Bug Fixes

    Fixed use-after-free in HTTP connection handling

    Issue: A race condition could occur during the HTTP connection establishment phase. If a connection object was freed while an asynchronous connection attempt was in progress, the callback on_connected might access invalid memory, leading to a crash (segmentation fault) or assertion failure in the event loop.

    Solution:

    • Introduced a connection state flag (HTTP_CON_FLAG_CONNECTING) to track pending connections.
    • Implemented a deferred deletion mechanism. If a connection is freed while connecting, the actual cleanup is postponed until the connection attempt completes (success or failure), ensuring the event loop watchers are safely stopped.

    Improvements

    Refactored HTTP connection flags

    Change: Replaced the boolean https field in the http_connection structure with a bitmask flags. Benefit: This change improves code extensibility, allowing for more connection states (like the new connecting state) to be managed efficiently within a single field without increasing memory usage.

    Build System

    Fix compilation with newer CMake

    Change: Updated the minimum required CMake version in CMakeLists.txt. Reason: Newer versions of CMake have deprecated or removed support for very old CMake versions (< 3.5). This ensures the project builds correctly in modern development environments.

    Full Changelog: https://github.com/zhaojh329/rtty/compare/v9.0.3...v9.0.4


    概述

    本次发布修复了 HTTP 代理功能中的一个严重稳定性问题,并改进了构建系统的兼容性。

    变更内容

    错误修复

    修复 HTTP 连接处理中的 Use-After-Free 问题

    问题描述: 在 HTTP 连接建立阶段可能发生竞态条件。如果在异步连接尝试进行时释放了连接对象,on_connected 回调函数可能会访问无效内存,导致程序崩溃(段错误)或触发事件循环的断言失败。

    解决方案:

    • 引入了连接状态标志 (HTTP_CON_FLAG_CONNECTING) 来追踪挂起的连接。
    • 实现了延迟删除机制。如果连接在建立过程中被释放,实际的清理工作会推迟到连接尝试完成(成功或失败)后进行,从而确保能够安全地停止事件循环观察者。

    改进

    重构 HTTP 连接标志

    变更: 将 http_connection 结构体中的 https 布尔字段替换为位掩码 flags。 收益: 此更改提高了代码的可扩展性,允许在不增加内存使用的情况下,在一个字段内高效地管理更多的连接状态(如新增的连接中状态)。

    构建系统

    修复在较新 CMake 版本下的编译问题

    变更: 更新了 CMakeLists.txt 中所需的最低 CMake 版本。 原因: 较新版本的 CMake 已经弃用或移除了对非常旧的 CMake 版本(< 3.5)的支持。此更新确保项目能在现代开发环境中正确构建。

    完整变更记录: https://github.com/zhaojh329/rtty/compare/v9.0.3...v9.0.4

  5. v9.0.32025-10-31 · 2025-10-31 01:41 UTC
    查看更新说明

    Bug Fixes

    Fixed auto-reconnect when domain name resolution fails

    Issue: When the rtty client encountered a domain name resolution failure (DNS lookup failure), it would not properly trigger the auto-reconnect mechanism. This caused the client to fail permanently instead of retrying the connection.


    错误修复

    修复域名解析失败时的自动重连功能

    问题描述: 当 rtty 客户端遇到域名解析失败(DNS 查询失败)时,无法正确触发自动重连机制。这导致客户端永久性失败,而不是重试连接。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    rtty (中文) - Access your device from anywhere via the web

    This project is officially supported by GL.iNet.

    license PRs Welcome Issue Welcome Release Version Build Status Downloads visitors

    Project website · Installation & usage guide

    Architecture

    flowchart TB
    s["rttys server"]
    u1["User (Web Browser)"] --> s
    u2["User (Web Browser)"] --> s
    u3["User (Web Browser)"] --> s
    s --> c1["rtty (Linux Device)"]
    s --> c2["rtty (Linux Device)"]
    s --> c3["rtty (Linux Device)"]
    

    Remote terminal in the browser File upload and download Access to a device's web interface

    Overview

    rtty is a remote access solution composed of device clients and the rttys server. This repository contains the C client; rttys provides the web interface and relays connections to devices. Open a terminal, transfer files, and access device services through a central server.

    Client Implementations:

    • C Client: Ultra-lightweight, designed for embedded Linux and resource-constrained devices.
    • Go Client: Easy cross-platform compilation, suitable for rapid integration and deployment.

    The server is implemented in Go, with a modern frontend built using Vue.

    Both browsers and device clients must be able to reach the server. Clients initiate connections to it, so devices behind NAT do not need public IP addresses or inbound port forwarding. Access devices through your browser and identify them by device ID and group.

    Use rtty to maintain OpenWrt routers, troubleshoot embedded Linux gateways, or manage distributed Linux devices remotely.

    Go client repository: https://github.com/zhaojh329/rtty-go

    Key Features

    🚀 Multi-language Client Options

    • C Client:

      • Ultra-lightweight, designed for embedded Linux and resource-constrained devices
      • Multiple SSL backends (OpenSSL, mbedtls, CyaSSl/wolfssl)
      • mTLS support for mutual authentication
    • Go Client:

      • Easy cross-platform compilation, suitable for rapid integration and deployment
      • Dependencies managed by the Go toolchain for straightforward builds and deployment
      • Connects to the same rttys server as the C client

    🔐 Security

    • TLS encryption for connections between device clients and rttys
    • Optional mutual TLS (mTLS) for certificate-based client authentication

    🌐 Advanced Remote Management

    • Batch command execution across multiple devices
    • Device identification and organization using IDs and groups
    • HTTP proxy support for accessing device web interfaces
    • TCP port forwarding for accessing TCP services through connected devices

    📁 File Management

    • Upload and download files through the web interface

    💻 Modern Terminal Experience

    • Full-featured terminal powered by Xterm.js
    • Browser-based access from anywhere
    • Virtual keyboard support for touch devices
    • Window splitting for multi-session and multitasking
    • Serial terminal forwarding support

    ⚡ Deployment & Compatibility

    • Simple deployment: configure the server and connect your devices to get started
    • Manage devices, access terminals, and transfer files through the web interface
    • Clients for Linux and OpenWrt environments

    Production Users

    Trusted by leading technology companies:

    Client Dependencies

    C Client Dependencies

    • Required:
      • libev - High-performance event loop library
      • inih - Lightweight INI parser for loading rtty config file
    • Optional (for SSL support):

    Go Client Dependencies

    • Go module dependencies are managed by the Go toolchain.

    ⭐ Star History

    Star History Chart

    🤝 Contributing

    Help us make rtty even better!

    See the CONTRIBUTING.md file for detailed guidelines on how to contribute to this project.

    ❤️ Donation