mirror of
https://github.com/alireza0/s-ui.git
synced 2026-09-29 19:19:03 +00:00
upgrade deprecated grpc call in v2rayAPI
This commit is contained in:
parent
119cff3d85
commit
bc6f356789
1 changed files with 2 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue