From c618ce543cc74f149d5de0171602bc0424c239ed Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 5 Feb 2016 10:23:16 +0000 Subject: [PATCH] use net.ParseAddress in socks udp --- proxy/socks/protocol/udp.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/proxy/socks/protocol/udp.go b/proxy/socks/protocol/udp.go index 11cbceff8..00615275b 100644 --- a/proxy/socks/protocol/udp.go +++ b/proxy/socks/protocol/udp.go @@ -75,12 +75,7 @@ func ReadUDPRequest(packet []byte) (*Socks5UDPRequest, error) { } domain := string(packet[5 : 5+domainLength]) request.Port = v2net.PortFromBytes(packet[5+domainLength : 5+domainLength+2]) - maybeIP := net.ParseIP(domain) - if maybeIP != nil { - request.Address = v2net.IPAddress(maybeIP) - } else { - request.Address = v2net.DomainAddress(domain) - } + request.Address = v2net.ParseAddress(domain) dataBegin = 5 + domainLength + 2 default: log.Warning("Unknown address type ", addrType)