Skip to content

Commit 68602bc

Browse files
authored
Merge pull request #34 from jjyr/respect-env-proxy
Download using proxy settings from ENV
2 parents 0a959c0 + 2a32394 commit 68602bc

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ edition = "2018"
1111

1212
[dependencies]
1313
anyhow = "1.0"
14-
ureq = "2.6"
14+
ureq = {version = "2.6", features = ["socks-proxy"] }
1515
dirs-next = "2.0.0"
1616
flate2 = "1.0"
1717
fs4 = "0.6.6"

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,11 @@ impl Download {
389389
}
390390

391391
fn download_binary(url: &str) -> Result<Vec<u8>> {
392-
let response = ureq::get(url).call()?;
392+
let response = ureq::builder()
393+
.try_proxy_from_env(true)
394+
.build()
395+
.get(url)
396+
.call()?;
393397

394398
let status_code = response.status();
395399

0 commit comments

Comments
 (0)