add sockopts config
This commit is contained in:
@ -154,7 +154,7 @@ func (h *httpHandler) handleRequest(ctx context.Context, conn net.Conn, req *htt
|
||||
}
|
||||
|
||||
if network == "udp" {
|
||||
return h.handleUDP(ctx, conn, network, req.Host, log)
|
||||
return h.handleUDP(ctx, conn, log)
|
||||
}
|
||||
|
||||
if req.Method == "PRI" ||
|
||||
|
@ -13,7 +13,7 @@ import (
|
||||
"github.com/go-gost/core/logger"
|
||||
)
|
||||
|
||||
func (h *httpHandler) handleUDP(ctx context.Context, conn net.Conn, network, address string, log logger.Logger) error {
|
||||
func (h *httpHandler) handleUDP(ctx context.Context, conn net.Conn, log logger.Logger) error {
|
||||
log = log.WithFields(map[string]any{
|
||||
"cmd": "udp",
|
||||
})
|
||||
|
@ -34,7 +34,7 @@ func (h *socks5Handler) parseMetadata(md mdata.Metadata) (err error) {
|
||||
if bs := mdata.GetInt(md, udpBufferSize); bs > 0 {
|
||||
h.md.udpBufferSize = int(math.Min(math.Max(float64(bs), 512), 64*1024))
|
||||
} else {
|
||||
h.md.udpBufferSize = 1024
|
||||
h.md.udpBufferSize = 1500
|
||||
}
|
||||
|
||||
h.md.compatibilityMode = mdata.GetBool(md, compatibilityMode)
|
||||
|
Reference in New Issue
Block a user