|
@@ -20,6 +20,7 @@ import (
|
|
"github.com/Workiva/go-datastructures/queue"
|
|
"github.com/Workiva/go-datastructures/queue"
|
|
statsservice "github.com/xtls/xray-core/app/stats/command"
|
|
statsservice "github.com/xtls/xray-core/app/stats/command"
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc"
|
|
|
|
+ "google.golang.org/grpc/credentials/insecure"
|
|
)
|
|
)
|
|
|
|
|
|
var trafficRegex = regexp.MustCompile("(inbound|outbound)>>>([^>]+)>>>traffic>>>(downlink|uplink)")
|
|
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 {
|
|
if p.apiPort == 0 {
|
|
return nil, nil, common.NewError("xray api port wrong:", p.apiPort)
|
|
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 {
|
|
if err != nil {
|
|
return nil, nil, err
|
|
return nil, nil, err
|
|
}
|
|
}
|