-
-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for NO_PROXY #1203
Comments
Go's NO_PROXY impl also supports cidr blocks which would require something like the |
Seems reasonable to me. PRs welcome. |
Ok so I spent some time on this and I had a look at reqwest, attohttpc, the no_proxy crate, Go's implementation and that article. It's a big mess 🙈 The rust implementations above seem to be closer to As for Kube, given the context we're in, IMO we should match Go's implementation as much as possible. Given the I ended up authoring this crate proxyvars with the explicit goal of matching Go's impl, which I'll be using until no_proxy support lands on kube-rs itself. But before we move on, what are your thoughts on this? Adding either no_proxy or proxyvars to kube would result in something like: pub fn proxy_url(&self) -> Result<Option<http::Uri>, KubeconfigError> {
if let Some(server_url) = &self.cluster.server {
if let Some(no_proxy) = proxyvars::no_proxy() {
if no_proxy.matches(server_url) {
return Ok(None);
}
}
} |
Hello, edit: I'm using rust 1.69.0 on macOS arm64 with kube 0.82.2, k8s-openapi 0.18.0 |
This package does not actually proxy the connection, you'll need to use something like hyper-proxy for that |
Ok. So, it supports http(s)_proxy environment variables but not proxies calls itself. It’s a bit curious for me 😀 thx |
So the proxy functionality is not implemented here. |
Would you like to work on this feature?
yes
What problem are you trying to solve?
kube-rs currently supports the HTTP_PROXY (and all its variants) environment variable, but not the NO_PROXY var.
kube/kube-client/src/config/file_loader.rs
Lines 110 to 127 in be15f7a
The NO_PROXY var is not standardised, but it's supported by Go and I think we could follow with similar support in here.
Describe the solution you'd like
change the
proxy_url
fn so that if NO_PROXY is set and the content matches thecluster.server
url, returnNone
, otherwise continue as usual.The matching impl could be similar to seanmonstar/reqwest#877
Describe alternatives you've considered
None
Documentation, Adoption, Migration Strategy
N/A
Target crate for feature
kube-client
The text was updated successfully, but these errors were encountered: