0

What I am trying to achive Pulling data, using a SaaS service, from a remote site with a simple GET request to mitmproxy. The SaaS service is not proxy aware. I want the SaaS web client to do a GET request to mitmproxy, basically like this:

GET /filelisting HTTP/1.1
Host: mitmproxy.url

I then want the mitmproxy to retrieve the content of the real site and serve it to the SaaS web client:

GET /filelisting HTTP/1.1
Host: realsite.url

So, to sum it up I'd like to perform a request to the proxy, have the proxy replace some of the headers, request with the modified headers and then serve the content to the client.

I've tried replacing the Host header using the --set-headers option for mitmproxy but when I try to access the mitmproxy.url I get the error message: "HttpError('Invalid HTTP request form (expected: absolute, got: relative)',)"

Not entirely sure if mitmproxy is able to perform this operation (but from what I understand it should be possible), and if it turns out it is not then please let me know if what other tools might be helping to solve the issue.

Any ideas?

xeet
  • 300
  • 2
  • 7

1 Answers1

1

You want to put mitmproxy in reverse proxy mode: http://docs.mitmproxy.org/en/latest/modes.html