Update On Fri Aug 16 20:33:05 CEST 2024

This commit is contained in:
github-action[bot]
2024-08-16 20:33:05 +02:00
parent 03f9f755df
commit 7390f900fb
199 changed files with 1989 additions and 14787 deletions

View File

@@ -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

View File

@@ -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 {

View File

@@ -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)

View File

@@ -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