refactor: rework limiter, traffic accounting, and logging (nlog)
This commit is contained in:
+17
-1
@@ -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"`
|
||||
|
||||
Reference in New Issue
Block a user