Charles 调试代理未检测 Eclipse 生成的流量?
我正在尝试调试一个使用 Jsoup 通过 Charles 调试代理发送和接收 http 流量的 Java 类,但 Charles 无法检测到任何流量。我想要做的是检查我的应用程序发送和接收的流量(主要是发送)。
我知道该连接可以工作,因为我可以打印请求返回的 HTML,并且我已将网络连接的“Active Provider”设置为本机,端口和主机与我在 Charles 中设置的内容相匹配......有什么我在吗?丢失的?有更好的方法吗?
我必须补充一点,告诉 Eclipse 检查更新会导致 Charles 增加流量!?
提前致谢!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要手动设置
java.net.HTTPURLConnection
上的代理信息。有一个 未完成的拉取请求,它为 Jsoup 添加了 java.net.Proxy 支持。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.我认为问题在于您如何设置代理。听起来您是在“首选项 ->”下执行此操作的一般->网络连接。这为 Eclipse 进程本身设置了代理,但这不是您想要的。您需要在从 Eclipse 启动的新进程上设置代理。这发生在启动配置中。启动配置中没有用于设置代理信息的特殊 UI,但这只是系统属性。
您可以阅读以下资源,了解需要设置的系统属性:
http:// www.rgagnon.com/javadetails/java-0085.html
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