mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
Revert "move away from dns.Server.ListenAndServe"
This reverts commit f0a801142d
.
This commit is contained in:
parent
f0a801142d
commit
813fdb6235
@ -10,7 +10,6 @@ import (
|
|||||||
"v2ray.com/core/app/policy"
|
"v2ray.com/core/app/policy"
|
||||||
"v2ray.com/core/app/proxyman"
|
"v2ray.com/core/app/proxyman"
|
||||||
_ "v2ray.com/core/app/proxyman/outbound"
|
_ "v2ray.com/core/app/proxyman/outbound"
|
||||||
"v2ray.com/core/common"
|
|
||||||
"v2ray.com/core/common/net"
|
"v2ray.com/core/common/net"
|
||||||
"v2ray.com/core/common/serial"
|
"v2ray.com/core/common/serial"
|
||||||
"v2ray.com/core/proxy/freedom"
|
"v2ray.com/core/proxy/freedom"
|
||||||
@ -43,19 +42,14 @@ func TestUDPServer(t *testing.T) {
|
|||||||
|
|
||||||
port := udp.PickPort()
|
port := udp.PickPort()
|
||||||
|
|
||||||
listener, err := net.ListenUDP("udp4", &net.UDPAddr{
|
|
||||||
IP: net.IP{127, 0, 0, 1},
|
|
||||||
Port: int(port),
|
|
||||||
})
|
|
||||||
common.Must(err)
|
|
||||||
|
|
||||||
dnsServer := dns.Server{
|
dnsServer := dns.Server{
|
||||||
PacketConn: listener,
|
Addr: "127.0.0.1:" + port.String(),
|
||||||
|
Net: "udp",
|
||||||
Handler: &staticHandler{},
|
Handler: &staticHandler{},
|
||||||
UDPSize: 1200,
|
UDPSize: 1200,
|
||||||
}
|
}
|
||||||
|
|
||||||
go dnsServer.ActivateAndServe()
|
go dnsServer.ListenAndServe()
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
config := &core.Config{
|
config := &core.Config{
|
||||||
@ -112,19 +106,14 @@ func TestPrioritizedDomain(t *testing.T) {
|
|||||||
|
|
||||||
port := udp.PickPort()
|
port := udp.PickPort()
|
||||||
|
|
||||||
listener, err := net.ListenUDP("udp4", &net.UDPAddr{
|
|
||||||
IP: net.IP{127, 0, 0, 1},
|
|
||||||
Port: int(port),
|
|
||||||
})
|
|
||||||
common.Must(err)
|
|
||||||
|
|
||||||
dnsServer := dns.Server{
|
dnsServer := dns.Server{
|
||||||
PacketConn: listener,
|
Addr: "127.0.0.1:" + port.String(),
|
||||||
|
Net: "udp",
|
||||||
Handler: &staticHandler{},
|
Handler: &staticHandler{},
|
||||||
UDPSize: 1200,
|
UDPSize: 1200,
|
||||||
}
|
}
|
||||||
|
|
||||||
go dnsServer.ActivateAndServe()
|
go dnsServer.ListenAndServe()
|
||||||
time.Sleep(time.Second)
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
config := &core.Config{
|
config := &core.Config{
|
||||||
|
Loading…
Reference in New Issue
Block a user