Skip to content

Commit 8ce60c0

Browse files
committed
replace deprecated function
1 parent 9045903 commit 8ce60c0

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

http-gateway/grpc-websocket-proxy/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ On the wire this uses newline-delimited json encoding of the messages.
99
Usage:
1010
```diff
1111
mux := runtime.NewServeMux()
12-
opts := []grpc.DialOption{grpc.WithInsecure()}
12+
opts := []grpc.DialOption{grpc.WithTransportCredentials(insecure.NewCredentials())}
1313
if err := echoserver.RegisterEchoServiceHandlerFromEndpoint(ctx, mux, *grpcAddr, opts); err != nil {
1414
return err
1515
}

pkg/net/grpc/stub_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package grpc_test
33
import (
44
"github.com/plgd-dev/hub/pkg/net/grpc/server"
55
"google.golang.org/grpc"
6+
"google.golang.org/grpc/credentials/insecure"
67
)
78

89
func StubGrpcServer(opts ...grpc.ServerOption) *server.Server {
@@ -16,7 +17,7 @@ func StubGrpcServer(opts ...grpc.ServerOption) *server.Server {
1617
}
1718

1819
func StubGrpcClient(addr string) StubServiceClient {
19-
conn, err := grpc.Dial(addr, grpc.WithInsecure())
20+
conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
2021
if err != nil {
2122
panic(err)
2223
}

0 commit comments

Comments
 (0)