From ecf8081ba63f15ec283979a3418951711ec30071 Mon Sep 17 00:00:00 2001 From: Maximilian Hils Date: Sat, 9 Aug 2014 03:03:21 +0200 Subject: implement passthrough mode, fixes #175 --- libmproxy/protocol/tcp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libmproxy/protocol/tcp.py') diff --git a/libmproxy/protocol/tcp.py b/libmproxy/protocol/tcp.py index 33c9ff05..a77a9096 100644 --- a/libmproxy/protocol/tcp.py +++ b/libmproxy/protocol/tcp.py @@ -1,6 +1,7 @@ from __future__ import absolute_import import select, socket from .primitives import ProtocolHandler +from netlib.utils import cleanBin class TCPHandler(ProtocolHandler): """ @@ -57,9 +58,9 @@ class TCPHandler(ProtocolHandler): # if one of the peers is over SSL, we need to send bytes/strings if not src.ssl_established: # only ssl to dst, i.e. we revc'd into buf but need bytes/string now. contents = buf[:size].tobytes() - self.c.log("%s %s\r\n%s" % (direction, dst_str, contents[:100]), "debug") + self.c.log("%s %s\r\n%s" % (direction, dst_str, cleanBin(contents)), "debug") dst.connection.send(contents) else: # socket.socket.send supports raw bytearrays/memoryviews - self.c.log("%s %s\r\n%s" % (direction, dst_str, buf[:100]), "debug") + self.c.log("%s %s\r\n%s" % (direction, dst_str, cleanBin(buf.tobytes())), "debug") dst.connection.send(buf[:size]) \ No newline at end of file -- cgit v1.2.3