diff --git a/grpc.go b/grpc.go index 2ed71bd..4ee1738 100644 --- a/grpc.go +++ b/grpc.go @@ -411,6 +411,11 @@ func (g *grpcClient) Call(ctx context.Context, req client.Request, rsp interface callOpts.Selector = g.opts.Selector } + // inject proxy address + if len(callOpts.Address) == 0 && len(g.opts.Proxy) > 0 { + callOpts.Address = []string{g.opts.Proxy} + } + // lookup the route to send the reques to route, err := client.LookupRoute(req, callOpts) if err != nil { @@ -514,6 +519,11 @@ func (g *grpcClient) Stream(ctx context.Context, req client.Request, opts ...cli callOpts.Selector = g.opts.Selector } + // inject proxy address + if len(callOpts.Address) == 0 && len(g.opts.Proxy) > 0 { + callOpts.Address = []string{g.opts.Proxy} + } + // lookup the route to send the reques to route, err := client.LookupRoute(req, callOpts) if err != nil {