When I run cargo, there seems to be a problem with the proxy server, but I can't find where I have made the http proxy setting. Please help

Please ask me what kind of situation this is. I seem to be using the proxy server 127.0.0.1:33210, but my system has the proxy closed, and at the same time my RustRover has also closed the proxy. When I try to run in cmd and PowerShell, no matter in any project, the following content will be prompted:

PS E:\Code\Rust\pvzhe-launcher> cargo add sysinfo
Updating crates.io index
warning: spurious network error (3 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 33210 after 2032 ms: Couldn't connect to server)
warning: spurious network error (2 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 33210 after 2046 ms: Couldn't connect to server)
warning: spurious network error (1 tries remaining): [7] Couldn't connect to server (Failed to connect to 127.0.0.1 port 33210 after 2051 ms: Couldn't connect to server)

But when I try the instruction like rustup toolchain install stable-x86_64-pc-windows-msvc, it does run and download normally. What is this situation? It has nothing to do with the project itself. I will be prompted with this content when I try it in multiple projects.

May I ask if cargo itself can set the http proxy independently, and then how to set and close it?

yes. please check your configuration, default to $CARGO_HOME/config.toml, the config key is http.proxy:

https://doc.rust-lang.org/cargo/reference/config.html#httpproxy

also check the environment variables mentioned in the documentation

1 Like

Thanks for the answer, I noticed that it may be that I git set up a proxy server

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.