Hi, We use Apache HTTPClient to submit our requests to the target web application hosted in WebSphere Liberty Application Server. Scenario is to check HTTPS proxy with Apache HTTPClient.
I am using Fiddler2 as the HTTPS proxy and submitting the requests using the Apache HTTPClient API. And as mentioned in [ http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e571 ] the following snippet works well where the requests are routed to the proxy. Here in the below code snippet the port 8888 is the fiddler port number and the application server port is 9944. DefaultHttpClient httpclient = new DefaultHttpClient(); HttpHost proxy = new HttpHost("localhost", 8888); httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy); However, the actual requirement is to make use of the JRE proxy configured at the system level, as detailed at: [ http://www.java.com/en/download/help/proxy_setup.xml ], using which I have setup the proxy as "locahost" and port as 8888. I am using ProxySelector.getDefault() as mentioned in the code snippet from [ http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html#d5e571 ]. DefaultHttpClient httpclient = new DefaultHttpClient(); ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner( httpclient.getConnectionManager().getSchemeRegistry(), ProxySelector.getDefault()); httpclient.setRoutePlanner(routePlanner); But the issue is, the request always goes directly to the target application server and not going via., the proxy. Is there any further httpclient configuration that I have to do? Thanks, Ravi Chamarthy --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
