mirror of
https://github.com/bolucat/Archive.git
synced 2025-12-24 13:28:37 +08:00
Update On Fri Aug 16 20:33:05 CEST 2024
This commit is contained in:
@@ -6,11 +6,13 @@ import (
|
||||
|
||||
// 全局pool
|
||||
var (
|
||||
BufferPool *BytePool
|
||||
BufferPool *BytePool
|
||||
UDPBufferPool *BytePool
|
||||
)
|
||||
|
||||
func init() {
|
||||
BufferPool = NewBytePool(constant.BUFFER_POOL_SIZE, constant.BUFFER_SIZE)
|
||||
UDPBufferPool = NewBytePool(constant.BUFFER_POOL_SIZE, constant.UDPBufSize)
|
||||
}
|
||||
|
||||
// BytePool implements a leaky pool of []byte in the form of a bounded channel
|
||||
|
||||
@@ -35,7 +35,7 @@ func (b *readerImpl) parsePingInfo(metricMap map[string]*dto.MetricFamily, nm *N
|
||||
metric, ok := metricMap["ehco_ping_response_duration_seconds"]
|
||||
if !ok {
|
||||
// this metric is optional when enable_ping = false
|
||||
zap.S().Warn("ping metric not found")
|
||||
zap.S().Debug("ping metric not found")
|
||||
return nil
|
||||
}
|
||||
for _, m := range metric.Metric {
|
||||
|
||||
@@ -179,7 +179,9 @@ func (c *ClashSub) ToRelayConfigs(listenHost string) ([]*relay_cfg.Config, error
|
||||
}
|
||||
rc.TCPRemotes = append(rc.TCPRemotes, remote)
|
||||
if proxy.UDP {
|
||||
rc.UDPRemotes = append(rc.UDPRemotes, remote)
|
||||
rc.Options = &relay_cfg.Options{
|
||||
EnableUDP: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
relayConfigs = append(relayConfigs, rc)
|
||||
|
||||
@@ -139,7 +139,9 @@ func (p *Proxies) ToRelayConfig(listenHost string, listenPort string, newName st
|
||||
TCPRemotes: []string{remoteAddr},
|
||||
}
|
||||
if p.UDP {
|
||||
r.UDPRemotes = []string{remoteAddr}
|
||||
r.Options = &relay_cfg.Options{
|
||||
EnableUDP: true,
|
||||
}
|
||||
}
|
||||
if err := r.Validate(); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user