mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 13:41:23 +08:00
Merge branch 'udp' into Alpha
This commit is contained in:
commit
9f1194056a
@ -76,9 +76,13 @@ func (sd *SnifferDispatcher) TCPSniff(conn net.Conn, metadata *C.Metadata) {
|
||||
}
|
||||
|
||||
func (sd *SnifferDispatcher) replaceDomain(metadata *C.Metadata, host string) {
|
||||
dstIP := ""
|
||||
if metadata.DstIP.IsValid() {
|
||||
dstIP = metadata.DstIP.String()
|
||||
}
|
||||
log.Debugln("[Sniffer] Sniff TCP [%s:%s]-->[%s:%s] success, replace domain [%s]-->[%s]",
|
||||
metadata.SrcIP, metadata.SrcPort,
|
||||
metadata.DstIP, metadata.DstPort,
|
||||
dstIP, metadata.DstPort,
|
||||
metadata.Host, host)
|
||||
|
||||
metadata.AddrType = C.AtypDomainName
|
||||
|
@ -269,7 +269,7 @@ func handleUDPConn(packet *inbound.PacketAdapter) {
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), C.DefaultUDPTimeout)
|
||||
defer cancel()
|
||||
rawPc, err := proxy.ListenPacketContext(ctx, metadata)
|
||||
rawPc, err := proxy.ListenPacketContext(ctx, metadata.Pure())
|
||||
if err != nil {
|
||||
if rule == nil {
|
||||
log.Warnln("[UDP] dial %s to %s error: %s", proxy.Name(), metadata.RemoteAddress(), err.Error())
|
||||
|
Loading…
Reference in New Issue
Block a user