From 0990ad0224114ad290fa27bc6733c0295c117806 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Thu, 16 May 2013 11:38:14 +0800 Subject: [PATCH] ipv6 --- server.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server.py b/server.py index a3fccfd..c94dac6 100755 --- a/server.py +++ b/server.py @@ -117,9 +117,7 @@ class Socks5Server(SocketServer.StreamRequestHandler): port = struct.unpack('>H', self.decrypt(self.rfile.read(2))) try: logging.info('connecting %s:%d' % (addr, port[0])) - remote = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - remote.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) - remote.connect((addr, port[0])) + remote = socket.create_connection((addr, port[0])) except socket.error, e: # Connection refused logging.warn(e)