add buffer size option for udp connection

This commit is contained in:
ginuerzh
2025-07-30 21:40:53 +08:00
parent b64e5901b6
commit a5309eee97
26 changed files with 218 additions and 219 deletions
+7 -1
View File
@@ -10,8 +10,13 @@ import (
mdutil "github.com/go-gost/x/metadata/util"
)
const (
defaultBufferSize = 4096
)
type metadata struct {
udpTimeout time.Duration
udpTimeout time.Duration
udpBufferSize int
sniffing bool
sniffingUDP bool
@@ -34,6 +39,7 @@ type metadata struct {
func (h *tungoHandler) parseMetadata(md mdata.Metadata) (err error) {
h.md.udpTimeout = mdutil.GetDuration(md, "udpTimeout", "tungo.udpTimeout")
h.md.udpBufferSize = mdutil.GetInt(md, "udp.bufferSize", "udpBufferSize")
h.md.sniffing = mdutil.GetBool(md, "sniffing")
h.md.sniffingUDP = mdutil.GetBool(md, "sniffing.udp")