-
Notifications
You must be signed in to change notification settings - Fork 205
Fixes proxy logic in RegistryClient. #314
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With all the changes it feels pretty leaky all over the codebase. Maybe we can chat on this one real-time and figure something out. I'll spend some cycles on it today.
94823fd
to
c57fe5e
Compare
// proxy configuration assumes all client requests will go to `base` URL | ||
self.proxyURL = ProxyUtils.proxyFromEnvironment(scheme: scheme, host: host) | ||
if let proxyURL = self.proxyURL, let proxyHost = proxyURL.host { | ||
httpConfiguration.proxy = HTTPClient.Configuration.Proxy.server(host: proxyHost, port: proxyURL.port ?? 8080) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is 8080 correct here or should it be 80?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be 80 given that I changed other things to be go-like. I'll rebase and fix.
Originally that's what I thought curl used and I was doing curl-style semantics. But 8080 is wrong there as well – curl actually defaults to 1080 🤷 (though the docs aren't clear whether this applies to just socks proxies)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
443 for https scheme, 80 otherwise now
- Fixes ProxyUtils so that the environment variable to be used for proxy selection is determined by the request scheme. - RegistryClient uses ProxyUtils to get the proxy URL used by the HTTPClient. - Tweak hostname resolution error message to avoid misleading output if the proxy hostname cannot be resolved.
HTTP_PROXY
but not other standard variables. #255.