API: Add user IPs and access times tracking (#4360)

This commit is contained in:
Maxim Plotnikov 2025-02-07 07:19:47 -05:00 committed by GitHub
parent 1982c2366e
commit e893fa1828
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 263 additions and 62 deletions

View file

@ -2,6 +2,7 @@ package stats
import (
"context"
"time"
"github.com/xtls/xray-core/common"
"github.com/xtls/xray-core/common/errors"
@ -30,6 +31,8 @@ type OnlineMap interface {
AddIP(string)
// List is the current OnlineMap ip list.
List() []string
// IpTimeMap return client ips and their last access time.
IpTimeMap() map[string]time.Time
}
// Channel is the interface for stats channel.