refactor: rework limiter, traffic accounting, and logging (nlog)

This commit is contained in:
xboard
2026-03-23 23:01:13 +08:00
parent 4676caac96
commit 3f1234a05c
20 changed files with 1721 additions and 1333 deletions
+17 -1
View File
@@ -118,10 +118,26 @@ type NodeConfig struct {
// Multiplex
Multiplex *MultiplexConfig `json:"multiplex,omitempty"`
// Proxy Protocol
// Proxy Protocol (supports both top-level and networkSettings for compatibility)
AcceptProxyProtocol bool `json:"accept_proxy_protocol,omitempty"`
}
// GetProxyProtocol returns true if AcceptProxyProtocol is set either at node level
// or in networkSettings (for panel compatibility).
func (nc *NodeConfig) GetProxyProtocol() bool {
if nc.AcceptProxyProtocol {
return true
}
if nc.NetworkSettings != nil {
if v, ok := nc.NetworkSettings["acceptProxyProtocol"]; ok {
if b, ok := v.(bool); ok {
return b
}
}
}
return false
}
type MultiplexConfig struct {
Enabled bool `json:"enabled"`
Protocol string `json:"protocol"`