mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-11-14 05:59:42 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0991024b45 |
@@ -57,26 +57,6 @@ func NewMetricsHandler(ctx context.Context, config *Config) (*MetricsHandler, er
|
|||||||
})
|
})
|
||||||
return resp
|
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{} {
|
expvar.Publish("observatory", expvar.Func(func() interface{} {
|
||||||
if c.observatory == nil {
|
if c.observatory == nil {
|
||||||
common.Must(core.RequireFeatures(ctx, func(observatory extension.Observatory) error {
|
common.Must(core.RequireFeatures(ctx, func(observatory extension.Observatory) error {
|
||||||
|
|||||||
@@ -234,6 +234,9 @@ func dnsQuery(server string, domain string, sockopt *internet.SocketConfig) ([]b
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, 0, err
|
return nil, 0, err
|
||||||
}
|
}
|
||||||
|
// h2c: in config is just for claim
|
||||||
|
// change scheme to https and expect outbound to handle TLS (freedom + tlsSetting)
|
||||||
|
req.URL.Scheme = "https"
|
||||||
req.Header.Set("Accept", "application/dns-message")
|
req.Header.Set("Accept", "application/dns-message")
|
||||||
req.Header.Set("Content-Type", "application/dns-message")
|
req.Header.Set("Content-Type", "application/dns-message")
|
||||||
utils.TryDefaultHeadersWith(req.Header, "fetch")
|
utils.TryDefaultHeadersWith(req.Header, "fetch")
|
||||||
|
|||||||
Reference in New Issue
Block a user