Fix: parse ip string when use socks proxy (#100)
This commit is contained in:
parent
d292743981
commit
ee7af27712
1 changed files with 5 additions and 0 deletions
|
@ -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) {
|
func (r *Resolver) ResolveIP(host string) (ip net.IP, err error) {
|
||||||
|
ip = net.ParseIP(host)
|
||||||
|
if ip != nil {
|
||||||
|
return ip, nil
|
||||||
|
}
|
||||||
|
|
||||||
query := &D.Msg{}
|
query := &D.Msg{}
|
||||||
dnsType := D.TypeA
|
dnsType := D.TypeA
|
||||||
if r.ipv6 {
|
if r.ipv6 {
|
||||||
|
|
Loading…
Reference in a new issue