diff options
Diffstat (limited to 'xray')
| -rw-r--r-- | xray/api.go | 6 | ||||
| -rw-r--r-- | xray/traffic.go | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/xray/api.go b/xray/api.go index 36b19875..1ce5afa1 100644 --- a/xray/api.go +++ b/xray/api.go @@ -213,6 +213,7 @@ func (x *XrayAPI) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error) { continue } isInbound := matchs[1] == "inbound" + isOutbound := matchs[1] == "outbound" tag := matchs[2] isDown := matchs[3] == "downlink" if tag == "api" { @@ -221,8 +222,9 @@ func (x *XrayAPI) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error) { traffic, ok := tagTrafficMap[tag] if !ok { traffic = &Traffic{ - IsInbound: isInbound, - Tag: tag, + IsInbound: isInbound, + IsOutbound: isOutbound, + Tag: tag, } tagTrafficMap[tag] = traffic traffics = append(traffics, traffic) diff --git a/xray/traffic.go b/xray/traffic.go index a1ef5186..7b907bae 100644 --- a/xray/traffic.go +++ b/xray/traffic.go @@ -1,8 +1,9 @@ package xray type Traffic struct { - IsInbound bool - Tag string - Up int64 - Down int64 + IsInbound bool + IsOutbound bool + Tag string + Up int64 + Down int64 } |
