Compare commits

...
2 Commits
2 changed files with 22 additions and 0 deletions
+2
View File
@@ -145,6 +145,8 @@
- [v2rayN](https://github.com/2dust/v2rayN)
- [GenyConnect](https://github.com/genyleap/GenyConnect)
- [OneXray](https://github.com/OneXray/OneXray)
- HarmonyOS
- [Hey](https://github.com/popsiclelmlm/Hey)
## Others that support VLESS, XTLS, REALITY, XUDP, PLUX...
+20
View File
@@ -57,6 +57,26 @@ func NewMetricsHandler(ctx context.Context, config *Config) (*MetricsHandler, er
})
return resp
}))
expvar.Publish("online", expvar.Func(func() interface{} {
resp := map[string]interface{}{}
c.statsManager.VisitOnlineMaps(func(name string, om feature_stats.OnlineMap) bool {
user := name
if parts := strings.Split(name, ">>>"); len(parts) >= 2 {
user = parts[1]
}
ips := map[string]int64{}
om.ForEach(func(ip string, lastSeen int64) bool {
ips[ip] = lastSeen
return true
})
resp[user] = map[string]interface{}{
"count": om.Count(),
"ips": ips,
}
return true
})
return resp
}))
expvar.Publish("observatory", expvar.Func(func() interface{} {
if c.observatory == nil {
common.Must(core.RequireFeatures(ctx, func(observatory extension.Observatory) error {