-
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: Add proxy dialer support. #481
Conversation
NOTE: I have not ported any of the tests over, but I can do that if this approach is preferable to #480. |
} | ||
|
||
// NOTE: Use net.Dialer to avoid dependency on grpc-go's internal package | ||
// conn, err := internal.NetDialerWithTCPKeepalive().DialContext(ctx, "tcp", newAddr) |
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.
do we need to then manually set keepalive?
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.
I don't think so. The current grpcurl
dialer doesn't set keepalive and the grpc-go
dailer only sets keepalive for select platforms, others get a vanilla dialer.
@@ -37,6 +37,8 @@ import ( | |||
"google.golang.org/protobuf/types/known/structpb" | |||
) | |||
|
|||
var GrpcurlUA string | |||
|
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.
this seems.... unfortunate...
This PR ports the internal
grpc-go
dialer with proxy support into thegrpcurl
package such thatgrpcurl
can support idiomatic proxy configuration via theHTTPS_PROXY
environment variable. The port does have a minor modification in that it uses the standard lib'snet.Dialer
rather than theNetDialerWithTCPKeepalive
from thegrpc-go
's internal package.This is an alternative to PR #480.
Addresses #166.