vscode-rust icon indicating copy to clipboard operation
vscode-rust copied to clipboard

HTTP proxy problem in Linux Desktop

Open izderadicka opened this issue 6 years ago • 3 comments

Hi I have Ubuntu desktop with Unity/Gnome and automatic proxy detection. Automatic proxy detection seem to work fine in VS Code, some Extensions work with proxy (like crates), RLS has problem - when I add new dependency to cargo.toml rls runs for a long time and then ends with this error:

failed to load source for a dependency on `bincode`
Unable to update registry `https://github.com/rust-lang/crates.io-index`
failed to fetch `https://github.com/rust-lang/crates.io-index`
failed to connect to github.com: No route to host; class=Os (2)

Fix is to run cargo build manually in terminal proper http_proxy and https_proxy env. variables. Look like the proxy detected in VS Code is not propagated to environment of RLS, when it is started?

izderadicka avatar Sep 12 '19 07:09 izderadicka

When code is started with http_proxy and https_proxy env. variables, then rls is OK, it's just in case when Desktop is setup for automatic proxy detection - chrome detects proxy OK I think but this proxy is not then passed to environment where rls is running.

izderadicka avatar Sep 12 '19 11:09 izderadicka

I have the same problem, do you have a solution now :)

ghost avatar Feb 20 '20 06:02 ghost

I have what I guess is the same problem on Windows: After starting VSCode and waiting some time (until after some minutes rls finally is up) I find those logs in Rust Language Server output:

[2021-03-16T14:50:25Z ERROR rls::actions] failed to fetch project model, using fallback: failed to download from `https://crates.io/api/v1/crates/winapi-i686-pc-windows-gnu/0.4.0/download`
[2021-03-16T14:51:57Z ERROR rls::actions] failed to fetch project model, using fallback: failed to download from `https://crates.io/api/v1/crates/winapi-i686-pc-windows-gnu/0.4.0/download`
[2021-03-16T15:03:08Z ERROR rls::actions] failed to fetch project model, using fallback: failed to download from `https://crates.io/api/v1/crates/winapi-i686-pc-windows-gnu/0.4.0/download`

I have Windows environment variable https_proxy set to http://x.x.x.x:yyyy and VSCode settings tell me: image So this should be propagated to VSCode - but is it?

Manual cargo build in Windows PowerShell works perfectly (including downloading necessary crates) so this is not an issue of my proxy, but rather VSCode or vscode-rust extension

Maybe related - I experience those too: https://github.com/rust-lang/rls/issues/1620 https://github.com/rust-lang/vscode-rust/issues/425

stefan-muc avatar Mar 16 '21 15:03 stefan-muc