我正在尝试通过Java代码连接到网站(http),在该代码中我将目标主机设置为mitm代理,但是在代理方面,我遇到了此错误
Invalid HTTP request form (expected: authority or absolute, got: relative)
xxx.xx.xx.xxx:xxxxx: HTTP protocol error in client request: Invalid HTTP request form (expected: authority or absolute, got: relative)
在Java响应中,我收到400错误请求。
以下是我要运行的代码:
HttpHost target = new HttpHost("xx.x.x.x7", xxxx);
HttpPost post = new HttpPost("http://weevil.info/");
post.addHeader("content-type", "application/x-www-form-urlencoded");
CloseableHttpClient client = HttpClientBuilder.create().build();
// send the post request
HttpResponse response = client.execute(target, post);
System.out.println(response);
用于运行mitm的命令:
mitmdump -p 8083 -s mitmProxy.py