Add stateless DNS hijack

This commit is contained in:
世界 2026-07-19 13:02:55 +08:00
parent 1ba7d79118
commit 79084fa798
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
5 changed files with 113 additions and 6 deletions

2
tun.go
View file

@ -14,12 +14,14 @@ import (
E "github.com/sagernet/sing/common/exceptions"
F "github.com/sagernet/sing/common/format"
"github.com/sagernet/sing/common/logger"
M "github.com/sagernet/sing/common/metadata"
N "github.com/sagernet/sing/common/network"
"github.com/sagernet/sing/common/ranges"
)
type Handler interface {
JudgeFlow(network uint8, source netip.AddrPort, destination netip.AddrPort, firstPacket []byte) FlowVerdict
NewDNSPacket(payload []byte, source M.Socksaddr, destination M.Socksaddr, writer N.PacketWriter)
N.TCPConnectionHandlerEx
N.UDPConnectionHandlerEx
}