Skip to content

Commit

Permalink
Merge pull request #34 from jjyr/respect-env-proxy
Browse files Browse the repository at this point in the history
Download using proxy settings from ENV
  • Loading branch information
drager authored Oct 14, 2024
2 parents 0a959c0 + 2a32394 commit 68602bc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ edition = "2018"

[dependencies]
anyhow = "1.0"
ureq = "2.6"
ureq = {version = "2.6", features = ["socks-proxy"] }
dirs-next = "2.0.0"
flate2 = "1.0"
fs4 = "0.6.6"
Expand Down
6 changes: 5 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,11 @@ impl Download {
}

fn download_binary(url: &str) -> Result<Vec<u8>> {
let response = ureq::get(url).call()?;
let response = ureq::builder()
.try_proxy_from_env(true)
.build()
.get(url)
.call()?;

let status_code = response.status();

Expand Down

0 comments on commit 68602bc

Please sign in to comment.