fix grpc client

This commit is contained in:
yanweidong 2025-10-06 23:02:44 +08:00
parent 2313df0bca
commit cf1e0d30eb
1 changed files with 2 additions and 1 deletions

View File

@ -13,6 +13,7 @@ import (
{import}
"git.apinb.com/bsm-sdk/core/vars"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/reflection"
"google.golang.org/protobuf/proto"
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
@ -42,7 +43,7 @@ func New(addr string) *Server {
conn, ok := srv.grpcConns[addr]
if !ok {
var err error
conn, err = grpc.Dial(addr, grpc.WithInsecure())
conn, err = grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
panic("failed to dial grpc server: " + err.Error())
}