Charles Debugging Proxy not detecting Eclipse-generated traffic?

3.2k Views Asked by At

I'm trying to debug a Java class that uses Jsoup to send and receive http traffic with the Charles Debugging Proxy but Charles is failing to detect any of the traffic. What I want to be able to do is inspect the traffic my app is sending and receiving (primarily sending).

I know that the connection works as I can print the HTML returned by my requests and I have set the network connection's "Active Provider" to native, the port and host match what I have set in Charles.... Is there something I am missing? Is there a better way to do this?

I must add that telling Eclipse to check for updates results in Charles picking that traffic up!?

Thanks in advance!

2

There are 2 best solutions below

1
On BEST ANSWER

I think the problem is how you are setting the proxy. It sounds like you are doing this under Preferences -> General -> Network Connections. That sets the proxy for the Eclipse process itself and isn't what you want. You need to set the proxy on the new process that you are launching from Eclipse. That happens in the launch config. There isn't special UI for setting up proxy information in the launch config, but it's all just system properties.

Here is a resource that you can read for which system properties you need to set:

http://www.rgagnon.com/javadetails/java-0085.html

1
On

You need to set proxy information on java.net.HTTPURLConnection manually. There is an outstanding pull request that adds java.net.Proxy support to Jsoup.