-
Notifications
You must be signed in to change notification settings - Fork 512
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
feat: 166: Proxy support #480
feat: 166: Proxy support #480
Conversation
…h supports proxies.
// of "https" because it is unaware that TLS is actually in use. | ||
conn, err := (&net.Dialer{}).DialContext(ctx, network, address) | ||
if err != nil { | ||
writeResult(err) |
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.
@jhump you probably have the most context on the custom dialer... maybe there was a desire to intercept dial errors here?
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.
Thanks for the quick feedback @dragonsinth! I had a similar thought, but I believe any dialer errors would be handled in a similar fashion (via writeResult()
) here.
Unfortunatley the default grpc-go
dialer is in an internal package, so if there is a desire to keep this error handling here I think the grpc-go
dialer code would need to be ported over to grpcurl
. I actually started down that path before opting for this approach. I would be happy to submit that PR as well if it would help evaluate how to address this feature request.
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.
Let's see if jhump has some "context" on this :)
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.
Hi @dragonsinth and @jhump, I went ahead and posted PR #481 which hopefully helps determine a path forward for proxy support gprcurl
. Thanks!
I reverted this patch and it resolves #496 |
This PR removes the custom dialer used by
grpcurl
such that the defaultgrpc-go
dialer is used. The defaultgrpc-go
dialer supports proxy configuration similar thenet.http
package (e.g. ProxyFromEnvironment).I'm assuming this is a safe change as all the tests continue to pass and I can now use the
HTTPS_PROXY
environment variable to routegrpcurl
calls through a proxy. That said, it is not clear to me why a custom dialer was used in the first place, so it is possible I am missing something here. (Based on my reading of the code, the custom dialer doesn't seem to add any additional functionality above and beyond a defaultnet.Dialer
.)I have been using
grpcurl
for a couple of years now, but have only recently needed to use it with a proxy, so I would appreciate any feedback on this PR. Thanks!Addresses #166