1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-02 23:35:40 -05:00

special handling for IPv6 from URL

This commit is contained in:
Darien Raymond
2017-11-21 18:46:28 +01:00
parent b0ac43a8fc
commit dd159cce6c
2 changed files with 18 additions and 0 deletions

View File

@@ -73,3 +73,15 @@ func TestNetIPv4Address(t *testing.T) {
assert(addr, IsIPv4)
assert(addr.String(), Equals, "1.2.3.4")
}
func TestParseIPv6Address(t *testing.T) {
assert := With(t)
ip := ParseAddress("[2001:4860:0:2001::68]")
assert(ip, IsIPv6)
assert(ip.String(), Equals, "[2001:4860:0:2001::68]")
ip = ParseAddress("[::ffff:123.151.71.143]")
assert(ip, IsIPv4)
assert(ip.String(), Equals, "123.151.71.143")
}