mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-04-18 11:39:11 -04:00
bug fixes to dns server
This commit is contained in:
@@ -34,7 +34,7 @@ func TestSinglePacket(t *testing.T) {
|
||||
data2Send := "Data to be sent to remote"
|
||||
payload := alloc.NewSmallBuffer().Clear().Append([]byte(data2Send))
|
||||
|
||||
go freedom.Dispatch(v2net.TCPDestination(v2net.IPAddress([]byte{127, 0, 0, 1}), port), payload, traffic)
|
||||
go freedom.Dispatch(v2net.TCPDestination(v2net.LocalHostIP, port), payload, traffic)
|
||||
traffic.InboundInput().Close()
|
||||
|
||||
respPayload, err := traffic.InboundOutput().Read()
|
||||
|
||||
@@ -21,7 +21,7 @@ func TestNormalRequestParsing(t *testing.T) {
|
||||
|
||||
request, err := ReadRequest(buffer, nil, false)
|
||||
assert.Error(err).IsNil()
|
||||
netassert.Address(request.Address).Equals(v2net.IPAddress([]byte{127, 0, 0, 1}))
|
||||
netassert.Address(request.Address).Equals(v2net.LocalHostIP)
|
||||
netassert.Port(request.Port).Equals(v2net.Port(80))
|
||||
assert.Bool(request.OTA).IsFalse()
|
||||
}
|
||||
@@ -110,7 +110,7 @@ func TestUDPRequestParsing(t *testing.T) {
|
||||
|
||||
request, err := ReadRequest(buffer, nil, true)
|
||||
assert.Error(err).IsNil()
|
||||
netassert.Address(request.Address).Equals(v2net.IPAddress([]byte{127, 0, 0, 1}))
|
||||
netassert.Address(request.Address).Equals(v2net.LocalHostIP)
|
||||
netassert.Port(request.Port).Equals(v2net.Port(80))
|
||||
assert.Bool(request.OTA).IsFalse()
|
||||
assert.Bytes(request.UDPPayload.Value).Equals([]byte{1, 2, 3, 4, 5, 6})
|
||||
|
||||
@@ -56,7 +56,7 @@ func init() {
|
||||
if rawConfig.Host != nil {
|
||||
socksConfig.Address = rawConfig.Host.Address
|
||||
} else {
|
||||
socksConfig.Address = v2net.IPAddress([]byte{127, 0, 0, 1})
|
||||
socksConfig.Address = v2net.LocalHostIP
|
||||
}
|
||||
return socksConfig, nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user