This commit is contained in:
qiangyanwen 2023-01-17 14:59:57 +08:00
parent 99b9c47b78
commit b7e0f2d1ad
1 changed files with 6 additions and 7 deletions

View File

@ -41,12 +41,12 @@ class Listener:
print("=====>", flow.request.data) print("=====>", flow.request.data)
print("=====>headers-====>", flow.request.headers) print("=====>headers-====>", flow.request.headers)
if 'ulogs.umeng.com/unify_logs' in url: # if 'ulogs.umeng.com/unify_logs' in url:
try: # try:
ctx.log.info('flow request:' + url) # ctx.log.info('flow request:' + url)
print('url===>' % (url)) # print('url===>' % (url))
except Exception as e: # except Exception as e:
ctx.log.error('mitmproxy intercept http error:' + repr(e)) # ctx.log.error('mitmproxy intercept http error:' + repr(e))
def response(self, flow): def response(self, flow):
resp = flow.response resp = flow.response
@ -56,7 +56,6 @@ class Listener:
class TlsStrategy(ABC): class TlsStrategy(ABC):
def __init__(self): def __init__(self):
# A server_address -> interception results mapping
self.history = collections.defaultdict(lambda: collections.deque(maxlen=200)) self.history = collections.defaultdict(lambda: collections.deque(maxlen=200))
@abstractmethod @abstractmethod