Add default mapping of localhost to ::1 and 127.0.0.1

This commit is contained in:
Lance Stout 2012-04-06 15:08:21 -04:00
parent af13bea2b8
commit 51e5aee830

View file

@ -115,6 +115,9 @@ def resolve(host, port=None, service=None, proto='tcp', resolver=None):
for host, port in hosts:
results = []
if host == 'localhost':
results.append(('::1', port))
results.append(('127.0.0.1', port))
for address in get_AAAA(host, resolver=resolver):
results.append((address, port))
for address in get_A(host, resolver=resolver):