<commit_before># Run this with mitmdump -q -s morph_proxy.py

import urllib

def response(context, flow):
  text = flow.request.method + " " + flow.request.scheme + "://" + flow.request.host + flow.request.path + " FROM " + flow.request.client_conn.address[0] + " REQUEST SIZE " + str(len(flow.request.content)) + " RESPONSE SIZE " + str(len(flow.response.content))
  print text
  url = "http://localhost:3000/connection_logs"<commit_msg>Turn on threading for proxy response handling<commit_after># Run this with mitmdump -q -s morph_proxy.py

import urllib
from libmproxy.script import concurrent

@concurrent
def response(context, flow):
  text = flow.request.method + " " + flow.request.scheme + "://" + flow.request.host + flow.request.path + " FROM " + flow.request.client_conn.address[0] + " REQUEST SIZE " + str(len(flow.request.content)) + " RESPONSE SIZE " + str(len(flow.response.content))
  print text
  url = "http://localhost:3000/connection_logs"
{'fraction_non_alphanumeric': 0.14583333333333334, 'fraction_numerical': 0.010416666666666666, 'mean_word_length': 4.429378531073446, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6836308', 'n_tokens_mistral': 323, 'n_tokens_neox': 309, 'n_words': 70}