Hello all,
When I bind the proxy to the local interface, I cannot replay requests. Is this a bug or an expected behaviour?
Consider the following example:
- Start mitmproxy with no arguments. Proxy will listen on port 8080 of all interfaces.
$ netstat -na | grep 8080 tcp 0 0 *.8080 *.* LISTEN
- Make a request through the proxy. Example:
http_proxy="http://127.0.0.1:8080" curl -v http://www.example.org
. A response is received. - Modify or just resend the request in mitmproxy (key
r
). A new response is received, and everything works correctly.
And the following:
- Start mitmproxy binding only to the local interface.
mitmproxy --listen-host 127.0.0.1
$ netstat -na | grep 8080 tcp 0 0 127.0.0.1.8080 *.* LISTEN
- Make a request through the proxy, as before. A response is received.
- Modify or just request the request in mitmproxy. Now the request fails after a while with an error. I see different error messages for HTTP and HTTPS requests. For HTTP, I get
Error connecting to "www.example.org": [Errno -5] no address associated with name
I want mitmproxy only to listen on my local interface. I know that, by default, remote requests are ignored (allow_remote
option is false
by default), but I believe mitmproxy should behave similarly in both cases presented above. Am I correct?
I am testing with the following version:
$ mitmproxy --version
Mitmproxy: 3.0.0dev0967 (5067438e)
Python: 3.6.0
OpenSSL: LibreSSL 2.5.3
Platform: OpenBSD-6.1-amd64-64bit
Thank you very much!