How to replay requests that were recorded in reverse proxy mode

Hi,

I need some help setting up mitmproxy to replay requests that were recorded in reverse proxy mode.

I have recorded it with:

mitmdump -w api.dump -p 1080 -R http://remoteapi.somewhere.com:80

I try to replay it with:

mitmdump -S api.dump -p 1080 —no-pop

But while replaying I get the error:

HTTP protocol error in client request: Invalid HTTP request form (expected authority or absolute…)

I can replay api.dump file in client mode just fine. What I would like to do is to replay it in server mode without touching the upstream server.

Can I do this with mitmproxy without using transparent mode? If so, what am I missing?

thanks in advance for your attention.
best regards,
Rod

I think I have found the answer:
mitmdump -S some.dump -R http://remote.server.net -p 1080 --no-pop

Perhaps this could be added to the docs on Server replay mode. Something like:
""“
If you have captured the session in reverse proxy mode, in order to replay it you still have to define the server URL, otherwise you may get the error: ‘HTTP protocol error in client request: Invalid HTTP request form (expected authority or absolute…)’.
”""

cheers,
Rod

Hi Rod,

Thanks for looking into this. If you could add a paragraph to https://github.com/mitmproxy/mitmproxy/blob/master/docs/features/serverreplay.rst, I’d merge it right away! :smiley:

Hi Maximilian, I have created the pull request: https://github.com/mitmproxy/mitmproxy/pull/1920.
Please revise and feel free to correct mistakes or style.
Thanks for the wonderful work you and the rest of the team are doing in mitmproxy.
best regards,
Rod

1 Like