fix proxy

This commit is contained in:
Daniel Flanagan 2024-03-18 23:05:51 -05:00
parent 870d9ea43f
commit 9cdbc9e2db
2 changed files with 3 additions and 2 deletions

View file

@ -1,3 +1,4 @@
use color_eyre::owo_colors::OwoColorize;
use reqwest::{ use reqwest::{
header::{HeaderMap, HeaderValue}, header::{HeaderMap, HeaderValue},
Client, Url, Client, Url,
@ -70,7 +71,7 @@ impl GitLab {
let url = Url::parse(url)?; let url = Url::parse(url)?;
let mut headers = HeaderMap::new(); let mut headers = HeaderMap::new();
headers.insert("PRIVATE-TOKEN", HeaderValue::from_str(token)?); headers.insert("PRIVATE-TOKEN", HeaderValue::from_str(token)?);
let proxy = reqwest::Proxy::http("socks5h://localhost:9982")?; let proxy = reqwest::Proxy::all("socks5h://localhost:9982")?;
let retry_policy = ExponentialBackoff::builder().build_with_max_retries(3); let retry_policy = ExponentialBackoff::builder().build_with_max_retries(3);
let base_client = Client::builder() let base_client = Client::builder()

View file

@ -8,7 +8,7 @@ pub struct Tasks {
impl Tasks { impl Tasks {
pub fn try_new() -> Result<Self, anyhow::Error> { pub fn try_new() -> Result<Self, anyhow::Error> {
let gitlab = GitLab::try_new("https://git.hq.bill.com", &env::var("GITLAB_TOKEN")?)?; let gitlab = GitLab::try_new("https://git.hq.bill.com/api/v4", &env::var("GITLAB_TOKEN")?)?;
Ok(Self { gitlab }) Ok(Self { gitlab })
} }
} }