mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-09 21:28:56 +00:00
XDNS finalmask: Support resolvers (client) and domains (server) instead of domain (#5872)
https://github.com/XTLS/Xray-core/pull/5872#issuecomment-4192730898 Example: https://github.com/XTLS/Xray-core/pull/5872#issuecomment-4196172391 --------- Co-authored-by: LjhAUMEM <llnu14702@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a91a88c7b2
commit
1642fdfbdd
@@ -10,9 +10,7 @@ import (
|
||||
|
||||
"github.com/xtls/xray-core/common/crypto"
|
||||
"github.com/xtls/xray-core/common/errors"
|
||||
"github.com/xtls/xray-core/transport/internet"
|
||||
"github.com/xtls/xray-core/transport/internet/finalmask"
|
||||
"github.com/xtls/xray-core/transport/internet/hysteria/udphop"
|
||||
"golang.org/x/net/icmp"
|
||||
"golang.org/x/net/ipv4"
|
||||
"golang.org/x/net/ipv6"
|
||||
@@ -54,13 +52,7 @@ type xicmpConnClient struct {
|
||||
mutex sync.Mutex
|
||||
}
|
||||
|
||||
func NewConnClient(c *Config, raw net.PacketConn, level int) (net.PacketConn, error) {
|
||||
_, ok1 := raw.(*internet.FakePacketConn)
|
||||
_, ok2 := raw.(*udphop.UdpHopPacketConn)
|
||||
if level != 0 || ok1 || ok2 {
|
||||
return nil, errors.New("xicmp requires being at the outermost level")
|
||||
}
|
||||
|
||||
func NewConnClient(c *Config, raw net.PacketConn) (net.PacketConn, error) {
|
||||
network := "ip4:icmp"
|
||||
typ := icmp.Type(ipv4.ICMPTypeEcho)
|
||||
proto := 1
|
||||
|
||||
Reference in New Issue
Block a user