Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CARGO: fix passing proxy settings to cargo commands #10795

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kLiHz
Copy link

@kLiHz kLiHz commented Aug 8, 2023

changelog: fix passing proxy-related environment vars to cargo commands

This PR:

  • sets up both http_proxy and https_proxy for cargo commands (previously only http_proxy is set, so cargo was not able to proxy https requests);
  • it also changes the url scheme to socks for the proxy URI (which is set up as http_proxy and https_proxy env vars' value) when PROXY_TYPE_IS_SOCKS is ture;
  • a socks_proxy env var will also be set when PROXY_TYPE_IS_SOCKS.

related issue: #3258

Here's also a naive rust program to check that those env vars are inherited from cargo run command (calling the cargo commands from the rust plugin):

use std::env;

fn main() {
    let keys: [&str; 3] = [
        "http_proxy",
        "https_proxy",
        "socks_proxy",
    ];
    for key in keys {
        match env::var(key) {
            Ok(val) => println!("{key} = {val}"),
            Err(e) => println!("{key} not found. {e}")
        }
    }
}

@kLiHz kLiHz changed the title CARGO: fix proxy settings CARGO: fix passing proxy settings to cargo commands Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant