-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add kubectl over socks5 proxy support #1
base: master
Are you sure you want to change the base?
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.
@drastawi did you test somehow that this still works with http/https proxy (manually)?
We can run minikube + tinyproxy (in a docker container), and verify this works for both http and https proxies. Happy to help with setup
@@ -129,6 +130,19 @@ func (s *SpdyRoundTripper) dial(req *http.Request) (net.Conn, error) { | |||
return s.dialWithoutProxy(req.Context(), req.URL) | |||
} | |||
|
|||
if proxyURL.Scheme == "socks5" { |
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.
use switch
with a fallthrough for http
, and https
, and error for default
} | ||
|
||
// dialWithoutProxy dials the host specified by url through an http or an https proxy. | ||
func (s *SpdyRoundTripper) dialWithHttpProxy(requestUrl *url.URL, proxyURL *url.URL) (net.Conn, error) { |
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.
The name of the function and the name in the comment do not match.
} | ||
|
||
// dialWithoutProxy dials the host specified by url through a socks5 proxy. | ||
func (s *SpdyRoundTripper) dialWithSocks5Proxy(requestUrl *url.URL, proxyURL *url.URL) (net.Conn, error) { |
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.
Function name and comment do not match.
@drastawi are you planning on getting this PR finished? I'm also trying to make use of a proxy for kubectl and look forward to seeing this get merged |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The PR allows fo call kubectl commands like exec over socks5 proxy.
Which issue(s) this PR fixes:
Fixes #kubernetes#58065
Special notes for your reviewer:
The pr will only impact only proxies with scheme
socks5
. The proxy connections withhttp
,https
are unchanged.Tests are not implemented, will need help with mocking the socks 5 setup.
Does this PR introduce a user-facing change?: