🌐
智能地理检测
自动 IP 地理定位,多 API 回退,网络性能测试,自动选择最优区域。
# 从 crates.io 安装
cargo install turbo-cdn
# 或从源码编译
git clone https://github.com/loonghao/turbo-cdn.git
cd turbo-cdn
cargo build --release# 智能下载(默认 - 自动选择最佳方式)
turbo-cdn dl "https://github.com/user/repo/releases/download/v1.0/file.zip"
# 获取优化后的 CDN URL
turbo-cdn optimize "https://github.com/user/repo/releases/download/v1.0/file.zip"
# 查看性能统计
turbo-cdn statsuse turbo_cdn::*;
#[tokio::main]
async fn main() -> turbo_cdn::Result<()> {
let downloader = TurboCdn::new().await?;
let result = downloader.download_from_url(
"https://github.com/user/repo/releases/download/v1.0/file.zip"
).await?;
println!("下载 {} 字节,速度 {:.2} MB/s",
result.size, result.speed / 1024.0 / 1024.0);
Ok(())
}| 包管理器 | 可用镜像 | 地理优化 |
|---|---|---|
| GitHub | 7 个镜像 | 中国、亚洲、全球 |
| Python PyPI | 清华、阿里云、豆瓣 | 中国优化 |
| Rust Crates | 清华、USTC | 中国优化 |
| Go Modules | goproxy.cn、阿里云 | 中国优化 |
| Docker Hub | USTC、网易、Docker China | 中国优化 |
| Maven Central | 阿里云、清华 | 中国优化 |
| jsDelivr | 5 个全球 CDN 节点 | 所有区域 |
| npm/unpkg | 多个 CDN 替代 | 全球 |
| 指标 | 数值 |
|---|---|
| CDN 规则 | 16+ 优化规则 |
| GitHub 镜像 | 7 个高质量源 |
| 包管理器 | 6+ 支持 |
| 质量评估 | 实时监控 |
| 并发控制 | 自适应 |
| 断点续传 | 完整支持 |