Rustup 镜像, 修改配置 ~/.zshrc or ~/.bashrc,windows直接配置环境变量 1 2 export RUSTUP_DIST_SERVER="https://rsproxy.cn" export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup" 安装 1 2 curl --proto '=https' --tlsv1.2 -sSf https://rsproxy.cn/rustup-init.sh | sh # windows直接使用官网下载的rustup-init.exe即可 设置cargo.io镜像,修改配置 ~/.cargo/config.toml,已支持git协议和sparse协议,>=1.68 版本建议使用 sparse-index,速度更快。 sparse 1 2 3 4 5 6 7 8 9 10 [source.crates-io] replace-with = 'rsproxy-sparse' [source.rsproxy] registry = "https://rsproxy.cn/crates.io-index" [source.rsproxy-sparse] registry = "sparse+https://rsproxy.cn/index/" [registries.rsproxy] index = "https://rsproxy.cn/crates.io-index" [net] git-fetch-with-cli = true rsproxy 1 2 3 4 5 6 7 8 9 10 [source.crates-io] replace-with = 'rsproxy' [source.rsproxy] registry = "https://rsproxy.cn/crates.io-index" [source.rsproxy-sparse] registry = "sparse+https://rsproxy.cn/index/" [registries.rsproxy] index = "https://rsproxy.cn/crates.io-index" [net] git-fetch-with-cli = true