|
@ -121,6 +121,7 @@ class Socks5Server(SocketServer.StreamRequestHandler): |
|
|
try: |
|
|
try: |
|
|
self.encryptor = encrypt.Encryptor(KEY, METHOD) |
|
|
self.encryptor = encrypt.Encryptor(KEY, METHOD) |
|
|
sock = self.connection |
|
|
sock = self.connection |
|
|
|
|
|
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) |
|
|
data = sock.recv(262) |
|
|
data = sock.recv(262) |
|
|
if not data: |
|
|
if not data: |
|
|
sock.close() |
|
|
sock.close() |
|
@ -202,6 +203,7 @@ class Socks5Server(SocketServer.StreamRequestHandler): |
|
|
# reply immediately |
|
|
# reply immediately |
|
|
aServer, aPort = self.getServer() |
|
|
aServer, aPort = self.getServer() |
|
|
remote = socket.create_connection((aServer, aPort)) |
|
|
remote = socket.create_connection((aServer, aPort)) |
|
|
|
|
|
remote.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) |
|
|
self.send_encrypt(remote, addr_to_send) |
|
|
self.send_encrypt(remote, addr_to_send) |
|
|
logging.info('connecting %s:%d' % (addr, port[0])) |
|
|
logging.info('connecting %s:%d' % (addr, port[0])) |
|
|
except socket.error, e: |
|
|
except socket.error, e: |
|
|