Mitmproxy received an absolute-form request error
See original GitHub issueSteps to reproduce the problem:
tcpdump result:
CONNECT sample.domain.com:80 HTTP/1.1
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Host: sample.domain.com:80
HTTP/1.1 200 Connection established
POST http://sample.domain.com/ajax/info/info HTTP/1.1
User-Agent: Unity/5.4.3p4 (Mac OS X 10.12.3; MacBookPro12,1)
Host: sample.domain.com
Accept-Encoding: gzip, identity
Proxy-Connection: Keep-Alive
Connection: Keep-Alive, TE
TE: identity
Content-Length: 0
Cookie: apv=1.0; abc=; abd=; abe=
HTTP/1.1 400 Bad Request
Server: mitmproxy 2.0.0
Connection: close
Content-Length: 436
Content-Type: text/html
<html>
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>400 Bad Request</h1>
<p>HttpException('Mitmproxy received an absolute-form request even though it is not running in regular mode. This usually indicates a misconfiguration, please see http://docs.mitmproxy.org/en/stable/modes.html for details.',)</p>
</body>
</html>HTTP/1.1 502 Bad Gateway
Server: mitmproxy 2.0.0
Connection: close
Content-Length: 479
Content-Type: text/html
<html>
<head>
<title>502 Bad Gateway</title>
</head>
<body>
<h1>502 Bad Gateway</h1>
<p>ProtocolException('HTTP protocol error in client request: Mitmproxy received an absolute-form request even though it is not running in regular mode. This usually indicates a misconfiguration, please see http://docs.mitmproxy.org/en/stable/modes.html for details.',)</p>
</body>
</html>
Any other comments? What have you tried so far?
I fixed this temporarily with https://github.com/mitmproxy/mitmproxy/blob/83f1e2eec01ab3edec723b252b0c109f00b77c56/mitmproxy/proxy/root_context.py#L100
- return protocol.Http1Layer(top_layer, http.HTTPMode.transparent)
+ return protocol.Http1Layer(top_layer, http.HTTPMode.regular)
System information
Mitmproxy version: 2.0.0 (release version) Python version: 3.6.0 Platform: Darwin-16.4.0-x86_64-i386-64bit SSL version: OpenSSL 1.1.0e 16 Feb 2017 Mac version: 10.12.3 (‘’, ‘’, ‘’) x86_64
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Transparent mode misconfiguration - mitmproxy
All seems normal as no error messages were returned by Linux. ... error in client request: Mitmproxy received an absolute-form request
Read more >Bad HTTP request line - Google Groups
Hi, I just upgraded to 0.9 (with the ubuntu packaged 0.8 I was running into 100% CPU consumption issues), but now mitmproxy seems...
Read more >Request is not going through mitm proxy when I am trying to ...
Invalid HTTP request form (expected: authority or absolute, got: relative) xxx.xx.xx.xxx:xxxxx: HTTP protocol error in client request: ...
Read more >test/mitmproxy/proxy/test_server.py - GitLab
Port error. 73. l.request.port = 1. 74. # In upstream mode, we get a 502 response from the upstream proxy server.
Read more >http.py - searchcode
186 187 form_in: The request form which mitmproxy has received. ... authority-form only) 200 201 port: Destination port (absolute-form and authority-form ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
–relax-http-form-validation not working
Yes, this is what most clients do. They send a
CONNECT
with the host they need a connection to, and then they only send relative paths.