Read HTTP proxy from env (#6765)
This PR will use http proxy from env for downloading files.
This commit is contained in:
parent
cbc2746d70
commit
5e81d780bd
2 changed files with 24 additions and 0 deletions
|
@ -1,3 +1,4 @@
|
|||
use crate::http_proxy_from_env;
|
||||
pub use anyhow::{anyhow, Result};
|
||||
use futures::future::BoxFuture;
|
||||
use isahc::config::{Configurable, RedirectPolicy};
|
||||
|
@ -95,6 +96,7 @@ pub fn client() -> Arc<dyn HttpClient> {
|
|||
isahc::HttpClient::builder()
|
||||
.connect_timeout(Duration::from_secs(5))
|
||||
.low_speed_timeout(100, Duration::from_secs(5))
|
||||
.proxy(http_proxy_from_env())
|
||||
.build()
|
||||
.unwrap(),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue