Now i have used littleporxy(version 1.1.0). i started a server with port(8082),then the littleproxy proxy it through port(8080).I visit http://127.0.0.1:8080/test by browser,the result is always Bad Request to URI: /test. But i can visit http://127.0.0.1:8082/test,the result is correct. public static void main(String[] args) throws Exception{ final ChainedProxyAdapter adapter = new ChainedProxyAdapter() { @Override public InetSocketAddress getChainedProxyAddress() { return new InetSocketAddress("127.0.0.1",8082); } }; ChainedProxyManager manager = new ChainedProxyManager() { @Override public void lookupChainedProxies(HttpRequest httpRequest, Queue<ChainedProxy> chainedProxies) { chainedProxies.add(adapter); } }; HttpProxyServerBootstrap boostrap = DefaultHttpProxyServer.bootstrap(); boostrap.withAllowLocalOnly(false) .withPort(8080) .withName("gateway") .withTransportProtocol(TransportProtocol.TCP).withChainProxyManager(manager).start(); } I hava found the uncorrect source of littleporxy,like the method of ClientToProxyConnection private static final Pattern HTTP_SCHEME = Pattern.compile("^http://.*", Pattern.CASE_INSENSITIVE); // short-circuit requests that treat the proxy as the "origin" server, to avoid infinite loops if (isRequestToOriginServer(httpRequest)) { boolean keepAlive = writeBadRequest(httpRequest); if (keepAlive) { return AWAITING_INITIAL; } else { return DISCONNECT_REQUESTED; } } private boolean isRequestToOriginServer(HttpRequest httpRequest) { // while MITMing, all HTTPS requests are requests to the origin server, since the client does not know // the request is being MITM'd by the proxy if (httpRequest.getMethod() == HttpMethod.CONNECT || isMitming()) { return false; } // direct requests to the proxy have the path only without a scheme String uri = httpRequest.getUri(); return !HTTP_SCHEME.matcher(uri).matches(); } Now the value of httpRequest.getUri() always start with "/",HTTP_SCHEME is defined by starting "http://",so !HTTP_SCHEME.matcher(uri).matches() is always wrong. And the method of isRequestToOriginServer(httpRequest) is always true,so the response is writeBadRequest(httpRequest) that is Bad Request to URI: /test
Thanks
wget https://facebook.com/index.html -e use_proxy on -e https_proxy= http://127.0.0.1:8082 -ca-crt=/mitm.cer