Compare commits

..
Author SHA1 Message Date
0991024b45 Handle ECH H2C query correctly
Co-Authored-By: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com>
2026-06-03 17:42:15 +00:00
2 changed files with 3 additions and 20 deletions
-20
View File
@@ -57,26 +57,6 @@ 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 {
+3
View File
@@ -234,6 +234,9 @@ func dnsQuery(server string, domain string, sockopt *internet.SocketConfig) ([]b
if err != nil {
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("Content-Type", "application/dns-message")
utils.TryDefaultHeadersWith(req.Header, "fetch")