diff --git a/listener/sing/sing.go b/listener/sing/sing.go index f53844dc..df55f100 100644 --- a/listener/sing/sing.go +++ b/listener/sing/sing.go @@ -5,6 +5,7 @@ import ( "errors" "net" "sync" + "time" "github.com/Dreamacro/clash/adapter/inbound" C "github.com/Dreamacro/clash/constant" @@ -19,6 +20,8 @@ import ( "github.com/sagernet/sing/common/uot" ) +const UDPTimeout = 5 * time.Minute + type ListenerHandler struct { TcpIn chan<- C.ConnContext UdpIn chan<- *inbound.PacketAdapter diff --git a/listener/sing_tun/server.go b/listener/sing_tun/server.go index 2e388440..1b97da19 100644 --- a/listener/sing_tun/server.go +++ b/listener/sing_tun/server.go @@ -78,7 +78,7 @@ func New(options config.Tun, tcpIn chan<- C.ConnContext, udpIn chan<- *inbound.P if options.UDPTimeout != 0 { udpTimeout = options.UDPTimeout } else { - udpTimeout = int64(C.DefaultUDPTimeout.Seconds()) + udpTimeout = int64(sing.UDPTimeout.Seconds()) } includeUID := uidToRange(options.IncludeUID) if len(options.IncludeUIDRange) > 0 {