'The handle_request method is run in the same thread each time, so we
need to run in a thread.
:param flow: A libmproxy flow containing the request
:return: None, we reply to flow'

def handle_request_in_thread(self, flow):

    http_request = self._to_w3af_request(flow.request)
    try:
        if self._should_be_trapped(http_request):
            http_response = self.on_start_edit_request(http_request)
        else:
            http_response = self._send_http_request(http_request)
    except Exception as e:
        trace = str(traceback.format_exc())
        http_response = self._create_error_response(http_request, None, e, trace=trace)
    http_response = self._to_libmproxy_response(flow.request, http_response)
    flow.reply(http_response)
