-
Notifications
You must be signed in to change notification settings - Fork 49
Open
Description
Hi,
I'm trying to use a domain instead of an IP address to generate the client
I've tried to edit the code and regenerate the client but it
Try 1 | Add dns//
func HandleIPAddressOrDomain(addr string, port string) (address string) {
ip := net.ParseIP(addr)
if ip != nil {
address = fmt.Sprintf("%s:%s", addr, port)
return address
}
_, err := net.LookupHost(addr)
if err == nil {
// https://github.com/grpc/grpc-go/issues/3795
address = fmt.Sprintf("dns//%s:%s", addr, port)
return address
}
return "UNCONFIGURED"
}Try 2 | Add resolver to grpc options
resolver := resolver.Get("dns")
var opts []grpc.DialOption
opts = append(opts,
grpc.WithTransportCredentials(credentials.NewTLS(config)),
grpc.WithPerRPCCredentials(common.NewToken(clientToken+"-"+uniqueID)),
grpc.WithResolvers(resolver), grpc.WithBlock())This returns an error at gClient.grpcClient.GetConfigurationMessage
[!] gClient.grpcClient.GetConfigurationMessage rpc error: code = Unavailable desc = I've lost track of other tries, but it seems the gRPC server returns an unclear error
Thanks
Metadata
Metadata
Assignees
Labels
No labels