Cargo配置socks5代理和添加国内镜像

修改$HOME/.cargo/config内容

1.socks5代理

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
[http]
proxy = "socks5://IP:PORT"
[https]
proxy = "socks5://IP:PORT"

2.国内镜像

[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = "rsproxy"

# 中国科学技术大学
[source.ustc]
registry = "git://mirrors.ustc.edu.cn/crates.io-index"

# ByteDance
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"

Related Posts