Xray-core/main/commands/all/api/api.go
Hossin Asaadi 2c72864935
API: Add user online stats (#3637)
* add statsUserOnline bool to policy

* add OnlineMap struct to stats

* apply UserOnline functionality to dispatcher

* add statsonline api command

* fix comments

* Update app/stats/online_map.go

Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com>

* improve AddIP

* regenerate pb

---------

Co-authored-by: mmmray <142015632+mmmray@users.noreply.github.com>
2024-11-03 08:44:15 -05:00

32 lines
635 B
Go

package api
import (
"github.com/xtls/xray-core/main/commands/base"
)
// CmdAPI calls an API in an Xray process
var CmdAPI = &base.Command{
UsageLine: "{{.Exec}} api",
Short: "Call an API in an Xray process",
Long: `{{.Exec}} {{.LongName}} provides tools to manipulate Xray via its API.
`,
Commands: []*base.Command{
cmdRestartLogger,
cmdGetStats,
cmdQueryStats,
cmdSysStats,
cmdBalancerInfo,
cmdBalancerOverride,
cmdAddInbounds,
cmdAddOutbounds,
cmdRemoveInbounds,
cmdRemoveOutbounds,
cmdInboundUser,
cmdInboundUserCount,
cmdAddRules,
cmdRemoveRules,
cmdSourceIpBlock,
cmdOnlineStats,
},
}