Skip to content

Commit

Permalink
tunnel works on local endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
nanwu committed Jan 4, 2016
1 parent a26011c commit aef355c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,17 @@ def sendall(self, _bytes):

def recvall(self):
data = b''
size = self._socket.recvexactly(4)
size = struct.unpack('>I', size)
data = self._socket.recvexactly(size)
size = self._recvexactly(4)
size = struct.unpack('>I', size)[0]
data = self._recvexactly(size)
return data

def _recvexactly(self, size):
data = b''
while size:
res = self._socket.recv(size)
data += res
size -= len(res)
return data

def _send_conn_request(self, dest):
Expand Down

0 comments on commit aef355c

Please sign in to comment.