summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/resolver.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-04-06 15:08:21 -0400
committerLance Stout <lancestout@gmail.com>2012-04-06 15:08:21 -0400
commit51e5aee8308e42a89b7c0ab83ec53e2abea9767f (patch)
treeb6895f10acb865f825b51ef1bc3d0b8f7d17bfa0 /sleekxmpp/xmlstream/resolver.py
parentaf13bea2b8abc0d8ff4d32c4c2554db550d473fd (diff)
downloadslixmpp-51e5aee8308e42a89b7c0ab83ec53e2abea9767f.tar.gz
slixmpp-51e5aee8308e42a89b7c0ab83ec53e2abea9767f.tar.bz2
slixmpp-51e5aee8308e42a89b7c0ab83ec53e2abea9767f.tar.xz
slixmpp-51e5aee8308e42a89b7c0ab83ec53e2abea9767f.zip
Add default mapping of localhost to ::1 and 127.0.0.1
Diffstat (limited to 'sleekxmpp/xmlstream/resolver.py')
-rw-r--r--sleekxmpp/xmlstream/resolver.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/resolver.py b/sleekxmpp/xmlstream/resolver.py
index ecb76519..db97f5fb 100644
--- a/sleekxmpp/xmlstream/resolver.py
+++ b/sleekxmpp/xmlstream/resolver.py
@@ -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):