We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 706d8af commit ba620bcCopy full SHA for ba620bc
build.rs
@@ -45,7 +45,16 @@ fn main() {
45
let url = format!("{}/{}", GITHUB_URL, download_filename);
46
let mut downloaded_bytes = Vec::new();
47
48
- let _size = ureq::get(&url)
+ let http_proxy = std::env::var("HTTPS_PROXY").or_else(|_| std::env::var("HTTP_PROXY"));
49
+ let agent = if let Ok(proxy) = http_proxy {
50
+ let proxy = ureq::Proxy::new(proxy).unwrap();
51
+ ureq::AgentBuilder::new().proxy(proxy).build()
52
+ } else {
53
+ ureq::AgentBuilder::new().build()
54
+ };
55
+
56
+ let _size = agent
57
+ .get(&url)
58
.call()
59
.unwrap()
60
.into_reader()
0 commit comments