fix: expvar error when observatory is not enabled & various typos

This commit is contained in:
yichya 2022-04-01 16:38:27 +08:00 committed by yuhan6665
parent 70306c4ec8
commit 755268b7d4
4 changed files with 12 additions and 7 deletions

View file

@ -64,6 +64,9 @@ func NewMetricsHandler(ctx context.Context, config *Config) (*MetricsHandler, er
c.observatory = observatory
return nil
}))
if c.observatory == nil {
return nil
}
}
var resp = map[string]*observatory.OutboundStatus{}
if o, err := c.observatory.GetObservation(context.Background()); err != nil {

View file

@ -11,7 +11,7 @@ import (
"github.com/xtls/xray-core/transport"
)
// OutboundListener is a net.Listener for listening pprof http connections.
// OutboundListener is a net.Listener for listening metrics http connections.
type OutboundListener struct {
buffer chan net.Conn
done *done.Instance
@ -60,7 +60,7 @@ func (l *OutboundListener) Addr() net.Addr {
}
}
// Outbound is a outbound.Handler that handles pprof http connections.
// Outbound is an outbound.Handler that handles metrics http connections.
type Outbound struct {
tag string
listener *OutboundListener