Add default mapping of localhost to ::1 and 127.0.0.1
This commit is contained in:
parent
af13bea2b8
commit
51e5aee830
1 changed files with 3 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue