From 51e5aee8308e42a89b7c0ab83ec53e2abea9767f Mon Sep 17 00:00:00 2001 From: Lance Stout Date: Fri, 6 Apr 2012 15:08:21 -0400 Subject: Add default mapping of localhost to ::1 and 127.0.0.1 --- sleekxmpp/xmlstream/resolver.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sleekxmpp/xmlstream') 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): -- cgit v1.2.3