I have created a plugin, in it I process the
def response(self, flow: mitmproxy.http.HTTPFlow):
callback. Everything works very well except I have no way of differentiating between connected devices.
Let’s say all I did was log the flow, the request and response to the console. If multiple devices are connected to the proxy, there is no way to know which traffic belongs to which device.
How could I solve this problem? Can I see what host the device used when connecting to the proxy? If one device sets up device1.mitmproxy.mydomain.com as its proxy and the other sets up device2.mitmproxy.mydomain.com, is there a way for me to retrieve that host information when processing the flow in my addon?
Alternatively, could authentication be used? If I start it with the --proxyauth option, could I retrieve user information when processing the flow in my addon?
Alternatively, can you think of any other way how I could uniquely attribute traffic to devices?