diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-05-23 00:22:15 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-05-23 00:22:15 +0300 |
| commit | 783fa856c32e1b9a66e31ec2864437691f0653a5 (patch) | |
| tree | d645ddba9a0e491b6cdc5bd38da56174a3ff1b43 /xray | |
| parent | 6139effb8ae69c6b0d2d31d3f98f00ad4be25fd7 (diff) | |
Fix deprecated gRPC Dial options for Insecure connections
Diffstat (limited to 'xray')
| -rw-r--r-- | xray/process.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xray/process.go b/xray/process.go index e7774ea4..3ce016ed 100644 --- a/xray/process.go +++ b/xray/process.go @@ -20,6 +20,7 @@ import ( "github.com/Workiva/go-datastructures/queue" statsservice "github.com/xtls/xray-core/app/stats/command" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) var trafficRegex = regexp.MustCompile("(inbound|outbound)>>>([^>]+)>>>traffic>>>(downlink|uplink)") @@ -243,7 +244,7 @@ func (p *process) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error) { if p.apiPort == 0 { return nil, nil, common.NewError("xray api port wrong:", p.apiPort) } - conn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%v", p.apiPort), grpc.WithInsecure()) + conn, err := grpc.Dial(fmt.Sprintf("127.0.0.1:%v", p.apiPort), grpc.WithTransportCredentials(insecure.NewCredentials())) if err != nil { return nil, nil, err } |
