Skip to content

Commit

Permalink
grpc.Dial is deprecated: use NewClient instead
Browse files Browse the repository at this point in the history
  • Loading branch information
MHSanaei committed Jul 1, 2024
1 parent 39aae6f commit 2da7dda
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xray/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,11 @@ func (x *XrayAPI) Init(apiPort int) (err error) {
if apiPort == 0 {
return common.NewError("xray api port wrong:", apiPort)
}
x.grpcClient, err = grpc.Dial(fmt.Sprintf("127.0.0.1:%v", apiPort), grpc.WithTransportCredentials(insecure.NewCredentials()))
conn, err := grpc.NewClient(fmt.Sprintf("127.0.0.1:%v", apiPort), grpc.WithTransportCredentials(insecure.NewCredentials()))
if err != nil {
return err
}
x.grpcClient = conn
x.isConnected = true

hsClient := command.NewHandlerServiceClient(x.grpcClient)
Expand Down

0 comments on commit 2da7dda

Please sign in to comment.