Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xray/api.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/xray/api.go b/xray/api.go
index 5242a613..ac384ed4 100644
--- a/xray/api.go
+++ b/xray/api.go
@@ -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)