I’m using mitmdump and I need make new requests from a web page (test.html). By example, in my inline script (test.py) I have a python function like this:
def makeNewRequest(data):
context, flow = savedFlow, savedContext #saved from prior request - global variables
flow.request.content = data
context.replay_request(flow)
I need run this “makeNewRequest” function from a button in test.html.
I plan to do using websockets from javascript in test.html to a python websocket server in my inline script test.py. This websocket server would be a new Thread inside test.py.
In this thread (How to view the proxy server’s URL) I read about create new script with Flask, and run commands from this script, but it seems both scripts (main script and Flask script) are not sharing global variables, so I don’t know how run “makeNewRequest” function from Flask script.
I know it is a little confusing my idea, but I hope you understand it.