use only ipv4 dns server
This commit is contained in:
parent
8165904eaf
commit
e51aa4f137
3 changed files with 6 additions and 3 deletions
3
CHANGES
3
CHANGES
|
@ -1,3 +1,6 @@
|
||||||
|
2.1.0 2014-08-10
|
||||||
|
- Use only IPv4 DNS server
|
||||||
|
|
||||||
2.1.0 2014-08-01
|
2.1.0 2014-08-01
|
||||||
- Does not ship config.json
|
- Does not ship config.json
|
||||||
- Better error message
|
- Better error message
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -6,7 +6,7 @@ with open('README.rst') as f:
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="shadowsocks",
|
name="shadowsocks",
|
||||||
version="3.0",
|
version="2.1.0",
|
||||||
license='MIT',
|
license='MIT',
|
||||||
description="A fast tunnel proxy that help you get through firewalls",
|
description="A fast tunnel proxy that help you get through firewalls",
|
||||||
author='clowwindy',
|
author='clowwindy',
|
||||||
|
|
|
@ -232,7 +232,7 @@ def is_ip(address):
|
||||||
for family in (socket.AF_INET, socket.AF_INET6):
|
for family in (socket.AF_INET, socket.AF_INET6):
|
||||||
try:
|
try:
|
||||||
socket.inet_pton(family, address)
|
socket.inet_pton(family, address)
|
||||||
return True
|
return family
|
||||||
except (TypeError, ValueError, OSError, IOError):
|
except (TypeError, ValueError, OSError, IOError):
|
||||||
pass
|
pass
|
||||||
return False
|
return False
|
||||||
|
@ -289,7 +289,7 @@ class DNSResolver(object):
|
||||||
parts = line.split()
|
parts = line.split()
|
||||||
if len(parts) >= 2:
|
if len(parts) >= 2:
|
||||||
server = parts[1]
|
server = parts[1]
|
||||||
if is_ip(server):
|
if is_ip(server) == socket.AF_INET:
|
||||||
self._servers.append(server)
|
self._servers.append(server)
|
||||||
except IOError:
|
except IOError:
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue