mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
fix: expvar error when observatory is not enabled & various typos
This commit is contained in:
parent
70306c4ec8
commit
755268b7d4
4 changed files with 12 additions and 7 deletions
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue