proxy - 在防火墙后面时,如何在 Windows 上使用 rustup 安装 Rust?

标签 proxy rust

downloaded rustup-init.exe .当我在家里运行它时,一切都很好,但是当我通过代理从我的办公室运行它时,我遇到了一个问题:

info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-stable.toml.sha256' to 'C:\Users\350627\.rustup\tmp\l3ogei4e89gnb1df_file
info: caused by: error during download
info: caused by: [6] Couldn't resolve host name (Couldn't resolve host 'static.rust-lang.org')

我在 Windows 上并且正确设置了 http_proxy 环境变量。

我尝试“自定义安装”,但没有给我手动提供 IP 地址的选项:

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

有人知道解决方法吗?

最佳答案

我听从了 aSpex 的建议...

  1. 转到 https://www.rust-lang.org/ -> 安装
  2. 下载 rustup-init.exe 到 ~/Downloads

  3. 在 powershell 中:

    $proxy='http://<IP>:<PORT>'
    
    $ENV:HTTP_PROXY=$proxy 
    $ENV:HTTPS_PROXY=$proxy
    cd ~\Downloads
    .\rustup-init.exe
    

关于proxy - 在防火墙后面时,如何在 Windows 上使用 rustup 安装 Rust?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42843329/

相关文章:

multithreading - 多个线程如何共享一个迭代器?

ruby - 如何从 Watir-Webdriver 更改 Opera 的代理设置?

python - 如何将代理身份验证传递给 python 请求模块

c# - 通过代理下载 PDF

rust - 特征 `std::future::Future` 未针对 `std::result::Result<reqwest::Response, reqwest::Error>` 实现

rust - 如何在 Rust 中按值返回结构?

rust - 单位类型实现了哪些特征?

rust - 我如何告诉 VS 代码我想使用什么工具链?

node.js - Nodejs - 将多个应用程序代理到本地的单个 url

heroku - Proximo heroku 插件在 https 请求上超时