From 1c9f6d53e782f034b7480c5d84988e170267bded Mon Sep 17 00:00:00 2001 From: Peter Edge Date: Mon, 14 Sep 2015 17:02:00 -0700 Subject: [PATCH] add grpc.WithInsecure() as option for grpc.Dial call in template --- examples/examplepb/a_bit_of_everything.pb.gw.go | 2 +- examples/examplepb/echo_service.pb.gw.go | 2 +- examples/examplepb/flow_combination.pb.gw.go | 2 +- protoc-gen-grpc-gateway/gengateway/template.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/examplepb/a_bit_of_everything.pb.gw.go b/examples/examplepb/a_bit_of_everything.pb.gw.go index d79901fa843..0d5c9284733 100644 --- a/examples/examplepb/a_bit_of_everything.pb.gw.go +++ b/examples/examplepb/a_bit_of_everything.pb.gw.go @@ -406,7 +406,7 @@ func request_ABitOfEverythingService_BulkEcho_0(ctx context.Context, client ABit // RegisterABitOfEverythingServiceHandlerFromEndpoint is same as RegisterABitOfEverythingServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterABitOfEverythingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string) (err error) { - conn, err := grpc.Dial(endpoint) + conn, err := grpc.Dial(endpoint, grpc.WithInsecure()) if err != nil { return err } diff --git a/examples/examplepb/echo_service.pb.gw.go b/examples/examplepb/echo_service.pb.gw.go index d9a2a9d02bf..12be49b930d 100644 --- a/examples/examplepb/echo_service.pb.gw.go +++ b/examples/examplepb/echo_service.pb.gw.go @@ -66,7 +66,7 @@ func request_EchoService_EchoBody_0(ctx context.Context, client EchoServiceClien // RegisterEchoServiceHandlerFromEndpoint is same as RegisterEchoServiceHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterEchoServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string) (err error) { - conn, err := grpc.Dial(endpoint) + conn, err := grpc.Dial(endpoint, grpc.WithInsecure()) if err != nil { return err } diff --git a/examples/examplepb/flow_combination.pb.gw.go b/examples/examplepb/flow_combination.pb.gw.go index da61a9d350e..669623e6bf0 100644 --- a/examples/examplepb/flow_combination.pb.gw.go +++ b/examples/examplepb/flow_combination.pb.gw.go @@ -786,7 +786,7 @@ func request_FlowCombination_RpcPathNestedStream_2(ctx context.Context, client F // RegisterFlowCombinationHandlerFromEndpoint is same as RegisterFlowCombinationHandler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func RegisterFlowCombinationHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string) (err error) { - conn, err := grpc.Dial(endpoint) + conn, err := grpc.Dial(endpoint, grpc.WithInsecure()) if err != nil { return err } diff --git a/protoc-gen-grpc-gateway/gengateway/template.go b/protoc-gen-grpc-gateway/gengateway/template.go index 66ed99a3153..9f6af772686 100644 --- a/protoc-gen-grpc-gateway/gengateway/template.go +++ b/protoc-gen-grpc-gateway/gengateway/template.go @@ -216,7 +216,7 @@ var ( // Register{{$svc.GetName}}HandlerFromEndpoint is same as Register{{$svc.GetName}}Handler but // automatically dials to "endpoint" and closes the connection when "ctx" gets done. func Register{{$svc.GetName}}HandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string) (err error) { - conn, err := grpc.Dial(endpoint) + conn, err := grpc.Dial(endpoint, grpc.WithInsecure()) if err != nil { return err }