diff --git a/build.rs b/build.rs index 2be2820..fa7f36c 100644 --- a/build.rs +++ b/build.rs @@ -45,7 +45,17 @@ fn main() { let url = format!("{}/{}", GITHUB_URL, download_filename); let mut downloaded_bytes = Vec::new(); - let _size = ureq::get(&url) + let http_proxy = std::env::var("HTTPS_PROXY").or_else(|_| std::env::var("HTTP_PROXY")); + let agent = if let Ok(proxy) = http_proxy { + let proxy = ureq::Proxy::new(proxy).unwrap(); + ureq::AgentBuilder::new() + .proxy(proxy) + .build() + } else { + ureq::AgentBuilder::new().build() + }; + + let _size = agent.get(&url) .call() .unwrap() .into_reader()