Skip to content

Commit

Permalink
Fix: parse ip string when use socks proxy (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondkmp authored and Dreamacro committed Feb 2, 2019
1 parent 42d33fe commit b594cbc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dns/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b594cbc

Please sign in to comment.