From bc6f35678939e51ee47ad3da2e1ca039e088b93b Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Tue, 22 Oct 2024 23:59:11 +0200 Subject: [PATCH] upgrade deprecated grpc call in v2rayAPI --- backend/singbox/v2rayApi.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/singbox/v2rayApi.go b/backend/singbox/v2rayApi.go index b6ff138..571edf9 100644 --- a/backend/singbox/v2rayApi.go +++ b/backend/singbox/v2rayApi.go @@ -10,6 +10,7 @@ import ( statsService "github.com/v2fly/v2ray-core/v5/app/stats/command" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) type V2rayAPI struct { @@ -22,7 +23,7 @@ func (v *V2rayAPI) Init(ApiAddr string) (err error) { if len(ApiAddr) == 0 { return common.NewError("The api address is wrong: ", ApiAddr) } - v.grpcClient, err = grpc.Dial(ApiAddr, grpc.WithInsecure()) + v.grpcClient, err = grpc.NewClient(ApiAddr, grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return err }