mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 13:32:24 +00:00
grpc.Dial is deprecated: use NewClient instead
This commit is contained in:
parent
39aae6fd16
commit
2da7dda794
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue