一个使用 Bun 和 TypeScript 构建的现代网络测速 CLI 工具。
简体中文 | English
Important
如本文和 README.md (英文版本) 不一致,请以前者为准。
- 🚀 使用 Bun.sh 高性能 JS Runtime 构建,冷启动快、内存占用低
- ✨ 支持多种测速服务器:
- Cloudflare (下载 & 上传)
- LibreSpeed (下载 & 上传)
- Ookla (开发中)
- 自定义文件 URL (暂不支持测试上传) 1
- 🧵 可自由配置并发测速线程数
- 📊 可测试以下指标:
- TCP/ICMP/HTTP 延迟
- 下载/上传速度
- 抖动分析
- 🎨 美观的 CLI 界面,支持实时进度显示
- 🛡️ 完备的 TypeScript 类型支持、使用 Biome 约束代码风格
测速服务端 | 上传测速 | 下载测速 | 延迟测试 | 备注 |
---|---|---|---|---|
Speedtest.net | 🔶 | 🔶 | 🔶 | 开发中、高优先级 |
LibreSpeed | ✅ | ✅ | ✅ | 主要用于高校测速站 |
Cloudflare Speed | ✅ | ✅ | ✅ | speed.cloudflare.com |
单文件测速 | ❌ | ✅ | ✅ | 不支持上传测速 |
Looking Glass | 🔶 | ✅ | ✅ | 开发中 |
全球网测 (信通院) | 🔶 | 🔶 | 🔶 | 开发中 |
Speedtest.cn | 🔶 | 🔶 | 🔶 | 开发中 |
从 Releases 下载最新的二进制文件压缩包
chmod +x aqua-speed
./aqua-speed
./aqua-speed.exe
docker run -it ghcr.io/alice39s/aqua-speed:latest
# Linux & macOS
curl -fsSL https://bun.sh/install | bash
# Windows
powershell -c "irm bun.sh/install.ps1 | iex"
# Windows (包管理器)
scoop install bun
git clone https://github.com/Alice39s/aqua-speed.git
bun install
bun run start
# 使用默认设置运行 (Cloudflare 服务器, 4 线程)
aqua-speed
# 测试 LibreSpeed 服务器
aqua-speed --type LibreSpeed
# 使用自定义文件 URL 测试
aqua-speed -s https://example.com/testfile.dat
aqua-speed [options]
Options:
-s, --server <url> 测速服务器 URL
--sn <name> 测速服务器名称
-t, --thread <number> 并发连接数
--timeout <seconds> 测试超时时间 (秒)
--debug 调试模式
--type <type> 测试类型 (SingleFile|LibreSpeed|Cloudflare)
Test Results:
Latency:
TCP: min = 1.25 ms, avg = 2.19 ms, max = 3.38 ms
ICMP: min = 1.00 ms, avg = 1.00 ms, max = 1.00 ms
HTTP: min = 97.74 ms, avg = 100.71 ms, max = 103.68 ms
Speed:
Download: min = 570.55 Mbps, avg = 1.17 Gbps, max = 1.36 Gbps
Upload: min = 601.25 Mbps, avg = 1.20 Gbps, max = 1.39 Gbps
Test Information:
Server: speed.cloudflare.com
Time: 2024/12/25 12:00:00
Permission denied
请确保文件有执行权限,使用 chmod +x aqua-speed
赋予执行权限。
- 速度慢
- 减少线程数:
-t 2
- 更换其他测速服务器
启用调试日志以获取详细信息:
./aqua-speed --debug
# 安装依赖
bun install
# 在开发模式下运行
bun run dev
# 运行测试
bun test
# 构建二进制文件
bun run build:binary
本项目使用 Biome 进行代码格式化和 lint (使用 biome format
和 biome check
):
# 格式化代码
bun run format
# 代码检查
bun run lint
- Fork 仓库
- 创建特性分支
- 提交更改
- 运行测试
- 提交 pull request
请确保:
- 测试通过
- 代码遵循 Biome 标准
- 提交信息清晰
- 文档已更新
参见 CHANGELOG.md 获取更多详细信息。
参见 Roadmap.md 获取更多详细信息。
- Bun - JavaScript 运行时和工具包
- LibreSpeed - 开源测速工具
- 所有贡献者
Footnotes
-
自定义文件 URL 暂不支持测试上传,仅支持下载、推荐指定 10MB 以上的文件。 ↩