From: Christian Ebner <c.ebner@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [PATCH proxmox-backup 1/3] http client: use http proxy from client options if set
Date: Wed, 11 Feb 2026 17:18:43 +0100 [thread overview]
Message-ID: <20260211161845.1006528-3-c.ebner@proxmox.com> (raw)
In-Reply-To: <20260211161845.1006528-1-c.ebner@proxmox.com>
The client already supports reading the proxy config from the env
variables, now it is also possible to specify it as optional
parameter via the http client options.
For backwards compatibility always use the env variable proxy setting
over the http client option.
To be used for setting the http proxy on remotes for sync jobs.
Signed-off-by: Christian Ebner <c.ebner@proxmox.com>
---
pbs-client/src/http_client.rs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/pbs-client/src/http_client.rs b/pbs-client/src/http_client.rs
index 4730db8d1..43f9a3367 100644
--- a/pbs-client/src/http_client.rs
+++ b/pbs-client/src/http_client.rs
@@ -134,6 +134,7 @@ pub struct HttpClientOptions {
fingerprint_cache: bool,
verify_cert: bool,
limit: RateLimitConfig,
+ proxy: Option<ProxyConfig>,
}
impl HttpClientOptions {
@@ -196,6 +197,11 @@ impl HttpClientOptions {
self.limit = rate_limit;
self
}
+
+ pub fn proxy(mut self, proxy: Option<ProxyConfig>) -> Self {
+ self.proxy = proxy;
+ self
+ }
}
impl Default for HttpClientOptions {
@@ -209,6 +215,7 @@ impl Default for HttpClientOptions {
fingerprint_cache: false,
verify_cert: true,
limit: RateLimitConfig::default(), // unlimited
+ proxy: None,
}
}
}
@@ -479,6 +486,8 @@ impl HttpClient {
}
let proxy_config = ProxyConfig::from_proxy_env()?;
+ let proxy_config = proxy_config.or(options.proxy.clone());
+
if let Some(config) = proxy_config {
info!("Using proxy connection: {}:{}", config.host, config.port);
https.set_proxy(config);
--
2.47.3
next prev parent reply other threads:[~2026-02-11 16:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 16:18 [PATCH proxmox{,-backup} 0/4] fix #3723: allow using node http proxy for remote connections Christian Ebner
2026-02-11 16:18 ` [PATCH proxmox 1/1] pbs-api-types: remote: add flag to use node proxy for remote connect Christian Ebner
2026-02-11 16:18 ` Christian Ebner [this message]
2026-02-11 16:18 ` [PATCH proxmox-backup 2/3] fix #3723: api: remote: optionally use node proxy config for http client Christian Ebner
2026-02-11 16:18 ` [PATCH proxmox-backup 3/3] ui: expose flag to use node's http proxy in remote edit window Christian Ebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260211161845.1006528-3-c.ebner@proxmox.com \
--to=c.ebner@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox