Fix: parse ip string when use socks proxy (#100)

This commit is contained in:
beyondkmp 2019-02-02 21:11:27 +08:00 committed by Dreamacro
parent 42d33fe629
commit b594cbc68d

View file

@ -155,6 +155,11 @@ func (r *Resolver) resolveIP(m *D.Msg) (msg *D.Msg, err error) {
}
func (r *Resolver) ResolveIP(host string) (ip net.IP, err error) {
ip = net.ParseIP(host)
if ip != nil {
return ip, nil
}
query := &D.Msg{}
dnsType := D.TypeA
if r.ipv6 {