Environment: MAC Proc
I have looked at HTTP Traffic monitoring issue when using MonoTouch, HttpClient and Charles Proxy.
Although my question is similar to it, my application is using RestTemplate http://docs.spring.io/autorepo/docs/spring-android/1.0.x/reference/html/rest-template.html. I am able to capture HTTP and HTTPS traffic whenever request is through web browsers (Safari and Chrome to be specific), whereas when I make rest requests through my application (which is basically using RestTemplate) Charles proxy is not capturing them.
From the answers to the above questions, it should be something related setting proxy setting on the RestTempate. But am a .NET developer and quite familiar with fiddler - but recently moved to Java and new to Charles - so it will be great if you can let me know specific details, or your thoughts on configuring rest template to use my mac os proxy...
Basically question is how to configure my rest template (client) such that the charles web proxy is able to capture the requests and responses through my application (client).
And rest template is instantiated by custom request factory which extends __https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/http/client/SimpleClientHttpRequestFactory.html.
Looks like I need to do something similar to this (reference: http://docs.spring.io/spring-integration/reference/html/http.html#http-proxy)
<bean id="requestFactory"
class="org.springframework.http.client.SimpleClientHttpRequestFactory">
<property name="proxy">
<bean id="proxy" class="java.net.Proxy">
<constructor-arg>
<util:constant static-field="java.net.Proxy.Type.HTTP"/>
</constructor-arg>
<constructor-arg>
<bean class="java.net.InetSocketAddress">
<constructor-arg value="123.0.0.1"/>
<constructor-arg value="8080"/>
</bean>
</constructor-arg>
</bean>
</property>
</bean>