Merge branch 'temp' into dev
This commit is contained in:
commit
761a264ed8
2 changed files with 16 additions and 4 deletions
10
local.py
10
local.py
|
@ -55,10 +55,16 @@ class Socks5Server(SocketServer.StreamRequestHandler):
|
||||||
while True:
|
while True:
|
||||||
r, w, e = select.select(fdset, [], [])
|
r, w, e = select.select(fdset, [], [])
|
||||||
if sock in r:
|
if sock in r:
|
||||||
if remote.send(self.encrypt(sock.recv(4096))) <= 0:
|
data = sock.recv(4096)
|
||||||
|
if data <= 0:
|
||||||
|
break
|
||||||
|
if remote.sendall(self.encrypt(data)) is not None:
|
||||||
break
|
break
|
||||||
if remote in r:
|
if remote in r:
|
||||||
if sock.send(self.decrypt(remote.recv(4096))) <= 0:
|
data = remote.recv(4096)
|
||||||
|
if data <= 0:
|
||||||
|
break
|
||||||
|
if sock.sendall(self.decrypt(data)) is not None:
|
||||||
break
|
break
|
||||||
finally:
|
finally:
|
||||||
sock.close()
|
sock.close()
|
||||||
|
|
10
server.py
10
server.py
|
@ -55,10 +55,16 @@ class Socks5Server(SocketServer.StreamRequestHandler):
|
||||||
while True:
|
while True:
|
||||||
r, w, e = select.select(fdset, [], [])
|
r, w, e = select.select(fdset, [], [])
|
||||||
if sock in r:
|
if sock in r:
|
||||||
if remote.send(self.decrypt(sock.recv(4096))) <= 0:
|
data = sock.recv(4096)
|
||||||
|
if data <= 0:
|
||||||
|
break
|
||||||
|
if remote.sendall(self.decrypt(data)) is not None:
|
||||||
break
|
break
|
||||||
if remote in r:
|
if remote in r:
|
||||||
if sock.send(self.encrypt(remote.recv(4096))) <= 0:
|
data = remote.recv(4096)
|
||||||
|
if data <= 0:
|
||||||
|
break
|
||||||
|
if sock.sendall(self.encrypt(data)) is not None:
|
||||||
break
|
break
|
||||||
finally:
|
finally:
|
||||||
sock.close()
|
sock.close()
|
||||||
|
|
Loading…
Reference in a new issue